I have a form that allows a user to enter personal information. I have managed to set mandatory fields where if they are not filled, the user cannot save the form. The problem is if a mandatory field is not filled in and the user hits save, the form referehes and entered information is lost. That is really annoying to the user and i would appreciate some help on how to set a message that tells the user what field is missing and does'nt refresh. here's the code that i have
if ($user && $pass && fname && lname) { insert into database user info}
Go ahead and add user.
I can't seem to get the else statement in there where if $fname is empty, it lets me know.
Thanks for the help in advance.