heres the code residing in a file on my server running apache 2 and php v 4.3.8:
(btw register globals is on, but as far as I understand it, that should not affect the code below)
[code=php]
<?php
session_start();
if(!isset($_SESSION[‘count’])) $_SESSION[‘count’]=1;
else $_SESSION[‘count’]++;
echo $_SESSION[‘count’];
?>
The intent, I hope, is obvious – everytime I reload or revisit the page, it should display a number incremented by one.
However – all I get is “1”. everytime. one one one … argh! This is important to me. Can anybody give me suggestions on where to start finding the source of these troubles?
Thanks!
EDIT: I thought I also should mention that I have tried adding: echo session_id(); at the bottom of the code, and my session ID is always the same, so I assume I have a live session, but the variable just wont seem to stick!