How do I check for an empty field in a form?
<?php
$formvalue = "on";
if(empty($formvalue)) { echo "I am empty!"; }
?>
People sometimes get confused between isset and empty - the former just checks whether the variable is present or not but ignores any value it may or may not have.
Comment on this Question and Answer >>>
ASK A QUESTION
More forms PHP Questions
how to display like table from database records?I currently use this form on my site: Name
How do I remove HTML tags from a string?
How can I check a value entered in a field on my form is a number?
if i send values to database ,but in that table zeros is added ,how can i rectify the error
