Mega Code Archive

 
Categories / Php / Form
 

Testing a required field

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