在我的注册表单中,如果用户单击提交时需要出现验证消息,则所有框中的整个文本都会消失,这意味着他们必须重新开始!
我需要添加什么 PHP 代码才能保留数据?
Username<span class="required">*</span>
<input name="user_name" type="text" id="user_name" minlength="5" >
Full Name<span class="required">*</span>
<input name="full_name" type="text" id="full_name" size="30"
Nationality <span class="required">*</span>
<select name="nationality" id="select8">
<option value="" selected></option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
</select>
<p align="center">
<input name="doRegister" type="submit" id="doRegister" value="Register">
</p>
EDIT:
我试过这个:
<?php
$email_field = ($_POST['usr_email']);
?>
Email<span class="required">*</span>
<input type="text" id="usr_email3" name="usr_email" value="<?php echo
$email_field; ?>" />
但它说 usr_email 没有定义