Click to See Complete Forum and Search --> : problem when mixing session in PHP with ajax


szpilman
October 18th, 2006, 11:53 AM
dear all,
i just start my way to learn AJAX
i am using a simple framework
AJAXGOLD.JS

i am tryin to make an application that combine the use of AJAX with session in PHP. but i got this message, when i do the 'session'-ing
this is the warning.

Warning:
Cannot send session cache limiter - headers already sent
(output started at c:\apache\htdocs\ajax\lat2_ajaxgold\chat.php:3) in
c:\apache\htdocs\ajax\lat2_ajaxgold\chat.php on line 6

if there is any idea of how to handle session + AJAX,
or give the links, i'd be very thankful

rgrds,

szpilman

Waqas_Badar
October 21st, 2006, 01:28 AM
When I call the function session_start() but before calling it some thing is going to be print on browser then this warning shown. For example

<html>
<?
if(!isset($_SESSION))
session_start();
?>
</html>

This will show a warning!

But following code will not show warning:

<?
if(!isset($_SESSION))
session_start();
?>
<html>
......................
</html>

szpilman
October 21st, 2006, 12:06 PM
thnx Badar :)
u got it right. i have corrected my code. some of the errors were also caused by incompatibilities in PHP functions that i used in my PHPTriad :( but i have resolved it. thnx badar :)