Re: No COOKIE Set?

From: Date: Thu, 01 Jan 2004 06:52:38 +0000
Subject: Re: No COOKIE Set?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-173591@lists.php.net to get a copy of this message
Hi Aidan and thanx for the answer. I placed the exit(); function below the setcookie() function and the page just keeps blank. No error is displayed. I have NOTICES turned off but that's no notice it should give me. Thanks again, Cesar "Aidan Lister" <aidan@virtualexplorer.com.au> escribió en el mensaje news:20040101064829.54718.qmail@pb1.pair.com... > Try putting the exit() before the redirect, and see if there's an error when > you attempt to set the cookie. > > > "Cesar Aracena" <lists@icaam.com.ar> wrote in message > news:20040101060113.4223.qmail@pb1.pair.com... > > Hi all, > > > > My head is about to explode here... I am trying to setup a cookie for > every > > new user that registers in my site and right after that, to send them to > the > > home page... is that so difficult? apparently yes... It does redirect, but > > when I try to "echo" the $MemberId cookie with: > > > > echo $_COOKIE["MemberId"]; > > > > Nothing happens... nothing is displayed... also, I can't find where these > > cookies are being stored. I am developing under WinXP, latest PHP and > latest > > MySQL... other cookies are being stored very well, but I don-t know > where... > > I'm displaying at http://localhost/..... ¿¿¿??? > > > > Here's my script: > > > > if ($use_same_data == "yes") // One kind of information stored > > { > > $query = "INSERT INTO members_info ....... )"; > > $result = mysql_query($query); > > $id = mysql_insert_id(); > > } > > > > elseif ($use_same_data == "") // Other kind of choice of information > for > > shipping address > > { > > $query = "INSERT INTO members_info .......)"; > > $result = mysql_query($query); > > $id = mysql_insert_id(); > > } > > > > if (!$result) > > { > > echo "Error code here"; > > } > > else > > { > > setcookie ("MemberId", $id, time()+31536000); > > header ("Location: $CFG->wwwroot"); > > exit(); > > } > > > > Thax in advanced, > > > > Cesar

« previous php.general (#173591) next »