私はこのビットのコードを持っています:
if(isset($_POST['register_form'])) {
if(isset($_POST['username']) &&
isset($_POST['password']) &&
isset($_POST['lastname']) &&
isset($_POST['email'])) {
Register();
}
else {
echo 'It seems like some information is missing. Please fill in the whole form.';
}
}
これは、次の形式に適用されます。
<form action="" method="post">
<fieldset>
<legend>Register Form</legend>
<input type="text" name="username" maxlenght="32" placeholder="Username"/> <br />
<input type="password" name="password" placeholder="Password" /> <br />
<input type="lastname" name="lastname" placeholder="Last name" /> <br />
<input type="email" name="email" placeholder="Email" maxlenght="1024" /> <br />
<input type="submit" value="Register" name="register_form" />
</fieldset>
</form>
私はこれが間違っていることを知っています。if ステートメントは、実際に「ユーザー名」、「パスワード」などのフォームがあるかどうかのみをチェックしますが、空かどうかはチェックしません。しかし、正しく入力されていないかどうかを確認する方法がわかりません。誰かが私を助けることができれば、それは素晴らしいことです.
前もって感謝します。