Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Contact – does not validate form in Oprea & Chrome Re: PHP Contact – does not validate form in Oprea & Chrome

#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
}

That basically says "if a field is empty, run code & die (stop processing), else continue with validation"