Forum Moderators: coopster

Message Too Old, No Replies

server problems?

         

ayushchd

6:30 pm on Aug 8, 2007 (gmt 0)

10+ Year Member



<? session_start();

if ($act == "reset" && $value =="") {
if (!isset($_COOKIE['user'])) {
header ("location:index.php");
} else{
"else part";

This code works well on my localhost bt when i run it on the server, it always redirects me to index.php, even when the cookie is set.

d40sithui

6:46 pm on Aug 8, 2007 (gmt 0)

10+ Year Member



the syntax looks rihgt to me, except for the $act=="reset" (i usually use if(strcasecmp($act, "reset")==0){} for strings comparison ), but even so, the header() shouldnt get executed. try printing our your cookie, seems like it is set somewhere

jatar_k

6:53 pm on Aug 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you may not be testing for the right thing, how do you set the cookie?

or are you testing a session cookie?