Hi everyone i've got a little problem.
Im having a .php page and i want it to be able to output different things depending on which time it is viewed. (output different html code)
(in every html code there is a <a href ...> link that points to the same .php file
There is a session giong on, and i have a $_SESSION['user'] variable
i want to register a new one, $_SESSION['hit_times']
the problem i have must be a logical one cos i get no php error. Thing is, i cant seem to be able of session_unregistering my variable by using
unset($_SESSION['hit_times'];
also,
$_SESSION['hit_times']++;
won't work
It's like a constant why?
Here's the code:
(PHP4.2.0, Apache 1.3.22)
=================================
session_start();
// if this is the first hit on the .php page, set the counter
if (!isset($SESSION['hit_times']))
$SESSION['hit_times'] = "1";
switch($_SESSION['hit_times'])
{
case "1":
$html = // blah blah
break;
case "2":
$html = // blah blah
break;
case "3":
$html = // blah blah
break;
default:
$html = 'Grrrrr...';
break;
}
// function which succesfully outputs $html
nice_output($html);
$_SESSION['hit_times']++;
====================
whenever i manually view the session file, or i use print session_encode(); the hit_times is always "1".
GRRRRRR
10000 OF THANXES TO ANYONE WHO GIVES ME AN ANSWER