Testing a required field : _POST « Form « PHP






Testing a required field

 
<?php
if (! strlen($_POST['flavor'])) {
   print 'You must enter your favorite ice cream flavor.';
}
?>
  
  








Related examples in the same category

1.Basic PHP form processing
2.Changing a value in $_POST
3.if else to check posted variables
4.Verifying a required element
5.Superglobals vs. Globals
6.Set Cookie Data