New here, so please bear with me....
Having problem with php sessions. I have tried the below code...
<?
session_start();
session_register('count');
$count = $_SESSION[count]++;
?>
You have been to this page <?=$count ?> times.<br>
and the following code....
<?
session_start();
if(!isset($count)) {
echo "first<br>";
if(session_is_registered("count"))
{
echo 'second<br>';
session_register("count");
//$count = session_register("count");
}}
else{ echo 'third<br>'; $count = 1; }
?>
You have been to this page <?=$count?> times.<br>
<?
echo 'fourth<br>';
$count++;
echo $count;
?>
but to no avail.....
What happens is that each time I refresh the browser, a new session is made with 1 being the int count, which means that my counter never gets any bigger.
Now, I am not attempting to make a counter with this, I am simply trying to gain an understanding of how sessions work.
This is basically the last step for my ecom site, and it has me hung up severely, any assistance would be greatly appreciated.
I am using localhost to test my site.