Re: Cookies detect and $_SESSION

From: Date: Mon, 05 Aug 2002 22:37:49 +0000
Subject: Re: Cookies detect and $_SESSION
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-111369@lists.php.net to get a copy of this message
Thanks for replying Jim, I've tried your suggestion, but unfortunately, it doesn't work. Either it will give me the error message with cookies enabled & disabled, or does not react. I thought by changing 'isset' to '!isset' (to accomodate the null condition of $_SESSION['cookie'] it might work. No go. It does not want to pick up on the null condition. Question is, if print_r($_SESSION); gives 'Array()' then there must be some way of using this. Is there some way of picking up on that empty $_SESSION[] (nothing seems to work). It's so frustrating that I can't get this to work -- it's such simple code -- I've been at it two days now! Tia, Andre On Monday 05 August 2002 06:06 pm, Jim Dam wrote: > if (isset($_SESSION['cookie'])) { > print error_message; > } > > ----- Original Message ----- > From: "Andre Dubuc" <aajdubuc@webhart.net> > To: <php-general@lists.php.net> > Sent: Monday, August 05, 2002 5:09 PM > Subject: [PHP] Cookies detect and $_SESSION > > > Later in the code, I've tried to pick up the empty Array that $_SESSION > > produces if the user has cookies disabled: > > > > <?php > > > > if ($_SESSION['cookie'] == "yes") { } > > else { > > print ("<h2>Cookies must be enabled to use this site</h2>"); > > } > > > > ?>

« previous php.general (#111369) next »