2
I have a code that’s giving error and I can’t fix it. The chunk of file giving error is this:
if(isset(!($_SESSION['username']) && ($_COOKIE['remember'] == "remember"))){
$cname = FilterText($_COOKIE['rusername']);
$cpass_hash = $_COOKIE['rpassword'];
$csql = mysql_query("SELECT password,id FROM users WHERE username = '".$cname."' LIMIT 1") or die(mysql_error());
$cnum = mysql_num_rows($csql);
if($cnum < 1){
setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
} else {
$crow = mysql_fetch_assoc($csql);
$correct_pass = $crow['password'];
if($cpass_hash == $correct_pass){
$_SESSION['username'] = $cname;
$_SESSION['password'] = $crow['password'];
$sql3 = mysql_query("UPDATE users SET ip_last = '".$remote_ip."' WHERE username = '".$cname."'");
header("location: me"); exit;
} else {
setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
setcookie("rpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
}
}
}
And the mistake is this:
Fatal error: Cannot use isset() on the result of an Expression (you can use "null !== Expression" Instead)