Sessions - More Info
| From: | Ethan Rosenberg | Date: | Wed, 30 Mar 2011 23:20:12 +0000 |
| Subject: | Sessions - More Info | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-312146@lists.php.net to get a copy of this message | ||
Dear List -
Thank you for your help in the past. This an update on my session problems.
Here is a simple test program. It never increments the session counter; ie, does not detect that $_SESSION has been set.
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<body>
<?php
if(isset($_SESSION['views']))
$_SESSION['views']=$_SESSION['views']+1;
else
$_SESSION['views']=1;
echo "Views=". $_SESSION['views'];
?>
</body></html> I have no idea what is wrong. I need to make my session variables work so that I can finish a project. Help and advice, please. Ethan Rosenberg MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)]