hi,
i have a common php page which initialises a few session variables. this is included in two other PHP pages. in one page i check the value of one particular variable. if it is one i do some processing.. in common i make it one (if it has not already being set). i use the new values of the other variables in the 2nd PHP page... but both scripts seem to break the
if (!isset()) in common and reinitialise variables everytime, thus causing problems in other PHP scripts....i have included important parts of Common.php and the 1st PHP file....Please help..as i cannot do without sessions...
session_start();
if (!isset($SESSION["sessDetail"],$SESSION["sessCartVis"],$SESSION["sessVARS"]))
{
$SESSION["sessAllItems"]="";
$SESSION["sessAllCost"]="";
$SESSION["sessVARS"]="";
//$sessCartIdx=1;
$_SESSION["sessDetail"]=1; //session that needs to be initalised
}
1st PHP page
include "common_classes1.php";
session_start();
setcon();
if ($SESSION["sessDetail"]==1)
{
echo"SessDetail:- "; echo $SESSION["sessDetail"]; echo"<br>";
$SESSION["sessDetail"]=2; //this gets reinitialised to 1 $SESSION["sessCategory"]=$POST["sltCategory"];
$SESSION["sessVARS"]=$HTTP_POST_VARS;
}