PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Does anybody have any idea why the following code does not execute correctly. I want the fields in the form to be checked for content on submission but the if condition is just passed even when there isn't any content held in the fields. I'm confused:
isset() only checks if the variables are set, so they can be empty but the first section of the checking will be passed even if no values are present in them.
A common format for checking form submission is to test if the submit button has been set and once that has been confirmed start testing the fields from the form.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Sorted it, was the silliest thing, turns out i was looking at all the wrong places. Never included the = symbol when when assigning the form name field: