Hello i just stuck in syntax, can anyone help me with next code?
class User {
protected $userID = preg_replace('#[^0-9]#i', '', $_SESSION['user_id']);
protected $useremail = preg_replace('#[^A-Za-z0-9@_.-]#i', '', $_SESSION['user']);
protected $userPassword = preg_replace('#[^A-Za-z0-9]#i', '', $_SESSION['user_password']);
public function CheckUserLogin(){
if(!isset($_SESSION['user'])){
header("location: login.php");
exit();
}
//Try to find user from session data in database
$sql = "SELECT * FROM users WHERE id = '$this->userID' AND email = '$this->useremail' AND password = '$this->userPassword' LIMIT 1";
$res = mysql_query($sql) or die(mysql_error());
$userMatch = mysql_numrows($res);
if ($userMatch == 0) {
header("location: login.php");
exit();
}
}
}