私は働いていたコードで働いています。しかし、突然、このメッセージがポップアップします。私は突然致命的なエラーを受けます。私はそれを理解していない
Fatal error: Uncaught exception 'Exception' with message 'Email is incorrect!' in C:\xampp\htdocs\Prototype\classes\User.php:23
Stack trace: #0 C:\xampp\htdocs\Prototype\index.php(14): User->setEmail(true) #1 {main} thrown in C:\xampp\htdocs\Prototype\classes\User.php on line 23
しかし、私はこれが何を意味するのか分かりません。私はtryとcatchを使ってみましたが、ポップアップし続けます。
これは、エラーが
public function setEmail($p_email)
{
if (empty($p_email)) {
throw new Exception('Email kan niet leeg zijn!');
}
$this->email = $p_email;
if (!filter_var($p_email, FILTER_VALIDATE_EMAIL)) {
throw new Exception('Email is incorrect!'); //here is the error (line 23)
}
}
これは、
$user = new User();
$user->setEmail($_SESSION['login']); //line 14
$currentUser = $user->getProfile();
$userEmail = $user->getEmail();
$userName = $user->getUserName();
$userID = $currentUser['userID'];
'echo $ _SESSION ['login'];' prints? –
電子メールアドレスではない電子メールをtrueに設定しようとしています( 'User-> setEmail(true)')。セッションのログイン値を渡してもよろしいですか? – aynber
なぜ「ログインステータス」をメールとして渡していますか? –