help with header/cookies ..

From: Date: Thu, 17 May 2001 15:13:22 +0000
Subject: help with header/cookies ..
Groups: php.general 
Request: Send a blank email to php-general+get-53252@lists.php.net to get a copy of this message
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

« previous php.general (#53252) next »