我已经使用Server Side Validation
in为 Form 编写了这段代码CORE PHP
if(empty($s_email)){
$er = "Please enter E-mail";
}else if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i", $s_email)){
$er="Email-ID is invalid!<br>";
}else if(!filter_var($s_secemail, FILTER_VALIDATE_EMAIL)){
$er="Secondary Email-ID is invalid!<br>";
<p>
<label class="required" for="s_email">Email Address:</label><br/>
<input type="text" id="s_email" class="half" value="" name="s_email"/>
</p>
<p>
<label for="s_secemail">Secondary Email Address:</label><br/>
<input type="text" id="s_secemail" class="half" value="" name="s_secemail"/>
</p>
我的问题是当我跳过该$s_secemail
字段时,我收到此消息“辅助电子邮件 ID 无效”,它不是强制性的