[FX.php List] Session variable problem... code

Alex Gates alex at gandrpublishing.com
Sun Apr 1 13:20:48 MDT 2007


You are using = instead of ==

Try:

if ($_SESSION['xxxx'] == 'y'){
     echo $_SESSION['xxxx'];
}else{
     echo "Okay";
}



Bob Patin wrote:
> So here's the code on the page I'm going to; I restarted my web server, 
> on the off-chance that it would make a difference, which it didn't.
> 
> As a 2nd test, i went to one of my shopping carts and added stuff to the 
> cart, then closed the browser, and as it should've, it forgot my cart 
> entries when I returned to the site. However, everytime I go to the site 
> quoted below, I get the value for the session variable that I've called 
> "xxxx" below.
> 
> Since I'm coming from a closed browser, and this is the first page I've 
> gone to, the IF statement should return "Okay" and not "y" as it is doing.
> 
> Any thoughts?
> 
>  Bob
> 
> 
> 
> <?php
> session_start();
> 
> include_once('FX/FX.php');
> include_once('FX/server_data.php');
> 
> if ($_SESSION['xxxx'] = 'y'){
>     echo $_SESSION['xxxx'];
> }else{
>     echo "Okay";
> }
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> 


More information about the FX.php_List mailing list