RE: [PHP] Session problem
| From: | Johnson, Kirk | Date: | Wed, 08 Aug 2001 18:30:39 +0000 |
| Subject: | RE: [PHP] Session problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-61884@lists.php.net to get a copy of this message | ||
> > > <?php
> > > session_start();
> > > global $count;
> > > session_register ("count");
> > > $count++;
> > > ?>
> > >
> > > Hello visitor, you have seen this page <?php echo
> > > $HTTP_SESSION_VARS["count"]; ?> times.<p>
There was a bug in PHP in versions prior to 4.0.6: $count and
$HTTP_SESSION_VARS["count"] did not reference the same value while on the
*current* page. Try this:
<?php
session_start();
$count++;
session_register ("count");
?>
Hello visitor, you have seen this page <?php echo $count; ?> times.
Kirk