Re: session not working on a php page



Suman wrote:
I have tried the new code


<?php
session_start();
if (isset($_SESSION['counter']))
$_SESSION['counter']++;
else
$_SESSION['counter'] = 1;
echo $_SESSION['counter'];
?>

enabled the error trapping and there is no errors.

There is no output before the session_start, the code is as is on the
php page. I have had a loook through firebug and the cookie is there
too.

Can someone use this code on a webpage and refresh the page to see if
it works. If it does can you please send me a link. Would be great
help, this is killing me :)

Kind regards
Suman


Suman,

I've done it - as have others who confirmed it works.

Can't send you a link - it's on my development system, which has restricted access.

When you say you "enabled error trapping" - did you add the lines I recommended to your php.ini file?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages

  • Re: session not working on a php page
    ... enabled the error trapping and there is no errors. ... php page. ... help, this is killing me:) ... Kind regards ...
    (comp.lang.php)
  • Re: session not working on a php page
    ... enabled the error trapping and there is no errors. ... have you deliberately inserted a fatal run-time error ... php page. ... This suggests that there is no output before the script. ...
    (comp.lang.php)