Forums

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

Home Forums Back End PHP Contact Form: errors execute for every field rather then individually Reply To: PHP Contact Form: errors execute for every field rather then individually

#196740
Senff
Participant

But when I try to do the if, else if, else if, else if, etc, etc, it says an unexpected ‘{‘ on line …

This should be simply because you’ve forgot a closing bracket somewhere, or forgot a semicolon, or some other character. Can’t tell for sure unless we see the actual code.

(It’s kinda difficult to see what you’re trying to do exactly since all your statements are (bla) and so I’m not sure about the actual structure.)

Alternative: do validation on the front end (with Javascript/jQuery), so that the form won’t even submit before all the validation passes.