I have a code that is giving error and I can not fix it. The snippet of the 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 error is as follows:
Fatal error: Can not use isset () on the result of an expression (you can use "null! == expression" instead)