Checking for an empty html form submission
Posted: Fri Jul 21, 2006 1:29 pm
I am checking for an empty html form that is submitted using <input name="title" type="text>.
But this is not working and I can't figure out why. If I submit the title form and it is empty, the code still goes to the //process stuff.
any thoughts?
Code: Select all
$title = $_POST['title'];
if ($title == ' ')
{
print "<p>This is a required field. Please go back and fill it out.</p>";
}
else{
// process stuff
}any thoughts?