Hello! I'm trying to get session variables working with my PHP v4.3.6. I know its pretty much built in with that version, but for some reason I'm having problems (its probably my ineptitude). I'm trying to get a simple counter working, here's what my code looks like:
<?php
if (!session_is_registered('count')) {
session_register('count');
$count = 1;
} else {
$count++;
}
?>
Hello visitor, you have seen this page <?php echo $count; ?> times.
</p>
To continue, <a href="nextpage.php?<?php echo strip_tags(SID); ?>">click
here</a>.
</p>
For some reason, my count variable is always unregistered after I refresh or go back to the page later.
It appends the SID to the end of the link thats shown when you move the mouse over the 'next page' link, and this SID is always changing, shouldn't it be the same for the same user??
<?php
if (!session_is_registered('count')) {
session_register('count');
$count = 1;
} else {
$count++;
}
?>
Hello visitor, you have seen this page <?php echo $count; ?> times.
</p>
To continue, <a href="nextpage.php?<?php echo strip_tags(SID); ?>">click
here</a>.
</p>
For some reason, my count variable is always unregistered after I refresh or go back to the page later.
It appends the SID to the end of the link thats shown when you move the mouse over the 'next page' link, and this SID is always changing, shouldn't it be the same for the same user??