RE: [PHP] help with header/cookies ..

From: Date: Thu, 17 May 2001 16:30:29 +0000
Subject: RE: [PHP] help with header/cookies ..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53267@lists.php.net to get a copy of this message
Sweet, thanks! Fixed it .. learn something new every day .. Chad -----Original Message----- From: Johnson, Kirk [mailto:kjohnson@zootweb.com] Sent: Thursday, May 17, 2001 12:19 PM To: Php-General@Lists. Php. Net Subject: RE: [PHP] help with header/cookies .. Add an exit(); immediately following all the header() calls. Hitting a header() does not end execution of the script, so without the exit() the last header() that gets called is the one that actually occurs. Kirk > -----Original Message----- > From: Chad Day [mailto:cday@atpco.com] > Sent: Thursday, May 17, 2001 9:13 AM > To: Php-General@Lists. Php. Net > Subject: [PHP] help with header/cookies .. > > > I'm submitting a form to a search page that performs > different searches > based on what engine was selected. One of these searches is > restricted, and > runs a function that checks for a cookie. If the user has no > cookie, they > are redirected to a login page. > > I've used echo tests to make sure the function is being run > correctly, that > I don't have a cookie, etc, and it all checks out. I > *SHOULD* be redirected > to a login page, but I am not. > > > if ($fromwhere == "ARCHIVES") { > check_cookie($cookiename); > Header("Location: gotosearch); > } > > switch ($fromwhere) { > case "SITE": > Header("Location: gotosearch2); > break; > case "ARCHIVES": > check_cookie($cookiename); > Header("Location: gotosearch3); > break; > } > > > I tried putting the check_cookie statement in and outside of > the switch > statement, but both places perform the cookie check, fail it, > but don't > redirect me, and continue to allow me to search? What is > wrong with my > code? Is there something I'm missing about how I'm handling my > headers/cookies? I have the check_cookie function working on > several other > parts of the site, but for some reason I can't get this to work .. :( > > Thanks, > Chad > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#53267) next »