I am using the following codes to create cookie and validate login, but some
members can't login, I checked their username and password is correct..

function docookie($id, $username, $passwd,$fname, $lname,
$suspended,$rememberme) {
   $info = base64_encode("$id:$username:$passwd:$fname:$lname:$suspended");
  if($rememberme)
  {
  setcookie("user",$info, time()+15552000,"/","domain.com");
  }
  else
  {
  setcookie("user",$info);
}
}

function cookiedecode($user) {
    global $cookie, $prefix;
  dbconnect();
    $user = base64_decode($userinfo);
    $cookie = explode(":", $userinfo);
    $result = mysql_query("select passwd from profile where
username='$cookie[1]'");
    list($pass) = mysql_fetch_row($result);
    if ($cookie[2] == $pass && $pass != "") {
 return $cookie;
    } else {
 unset($user);
 unset($cookie);
    }
}

what i am i doing wrong??
They're sending email from hotmail account sop i am assuming their browser
supports cookie..

please help... many thanks in advance
huzz



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to