Forum Moderators: coopster
<?php
session_save_path("/nfs/cust/5/0/1/red/PHP/chem/sessions/a/tmp/");
session_start();
$_SESSION['count'] = $_POST['count'];
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
echo "Count = ".$_SESSION['count']
?>
P.S. Btw, I also tried replacing $_SESSION with $HTTP_SESSION_VARS but still no luck.
a couple of error checking options then, we need to see what part of the if statement it is hitting since that is the portion that is incrementing the count var. Maybe try this
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
echo 'count not set';
} else {
echo 'incrementing count var from ',$_SESSION['count'];
$_SESSION['count']++;
echo ' to ',$_SESSION['count'];
}