登録フォームに空の投稿を送信するとエラーメッセージが表示されます
注意:未定義のインデックス:34行目の/opt/lampp/htdocs/user/register.phpの用語
34行目で私はこれを持っています
$terms = trim($_POST["terms"]);
そして私がこれを持っている形で
<p>
<input type="checkbox" name="terms" id="terms"> I have read and accept the conditions of use
</p>
これがすべての検証フォームです
if(!empty($_POST))
{
$errors = array();
$terms = trim($_POST["terms"]);
$captcha = md5($_POST["captcha"]);
$name = trim($_POST["name"]);
if($terms == "")
{
$errors[] = lang("ACCOUNT_SPECIFY_NAME");
}
//End data validation
if(count($errors) == 0)
{
//Construct a user object
$user = new User($username,$password,$email,$name,$lastname);
//Checking this flag tells us whether there were any errors such as possible data duplication occured
if(!$user->status)
{
if($user->username_taken) $errors[] = lang("ACCOUNT_USERNAME_IN_USE",array($username));
if($user->email_taken) $errors[] = lang("ACCOUNT_EMAIL_IN_USE",array($email));
if($user->email_blocked) $errors[] = lang("ACCOUNT_EMAIL_BLOCKED");
}
else
{
//Attempt to add the user to the database, carry out finishing tasks like emailing the user (if required)
if(!$user->userCakeAddUser())
{
if($user->mail_failure) $errors[] = lang("MAIL_ERROR");
if($user->sql_failure) $errors[] = lang("SQL_ERROR");
}
}
}
}
?>
なぜこのアラートメッセージが表示されたのですか?
ありがとう