If I put a
echo $_SESSION['counter_file'] . ' testxxxxxxxxx ' . $counterFile;
Before and after the conditional, $_SESSION['counter_file'] is set after the conditional, as it should be. But, it is gone from the before echo when the function is recalled.
The Session buffer looses the value.
session_start() is called again before returning to the function; but, I thought repeated session_starts() were ignored and thus should not restart the session.
I use the session buffer extensively in other places without any problem.
Matt Matijevich wrote:
[snip]
session_start();
if($_SESSION['counter_file'] !==$counterFile) //See if visitor has already been counted for this page
{$num += 1; $_SESSION['counter_file'] = $counterFile;
}
echo $_SESSION['counterFile'] . ' testxxxxxxxxx ' . $counterFile; [/snip]
might just be a typeo but do you mean: echo $_SESSION['counter_file'] .
' testxxxxxxxxx ' . $counterFile;
instead of this: echo $_SESSION['counterFile'] . ' testxxxxxxxxx ' .
$counterFile;
?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php