All I did was tell you where you error was coming from in that one little line of code. It wasn't going to remove all of your problems if there were more.
The form validation you putting this through is a bit much. You only need to check if the form has been submitted once, and you only need to check if the fields are empty once. You also have an extra closing bracket at the bottom "}"