如何使用PHP过滤和验证表单中的选择选项

时间:2019-12-23 05:01:13

标签: php forms validation select dropdown


$batch = htmlentities($_POST['batch']);
if($batch === 'NULL'){
echo "Batch Failed";
} else {
echo "$bacth";
}
<div class="col-md-12">
   <div class="form-group">
      <div class="input-group">
         <span class="input-group-addon"><i class="fa fa-globe"></i></span>
         <select class="form-control" name="batch" id="select">
            <option selected disabled>Batch Preference</option>
            <option value="Weekends">Weekends</option>
            <option value="Holidays">Holidays</option>
         </select>
      </div>
   </div>
</div>

如何使用php选择那些选择选项,我如何验证它们...

谢谢

0 个答案:

没有答案