Home › Forums › Back End › PHP Contact – does not validate form in Oprea & Chrome › Re: PHP Contact – does not validate form in Oprea & Chrome
April 3, 2010 at 7:46 am
#73390
Irrorate
Member
To make sure all the fields have a value, you’d need to run something like:
Code:
if(empty($_POST[‘name’]) || empty($_POST[’email’]) || empty($_POST[‘comments’])){
//run code here
die()
} else {
//continue with validation
}
//run code here
die()
} else {
//continue with validation
}
That basically says "if a field is empty, run code & die (stop processing), else continue with validation"