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!
Well I have two documents, one called "test.php" and the other "test2.php". I want to validate my First Name form so that when someone enters something that is not alphabetic, or they leave it black then you get redirected back to test.php with the values that you have entered still in the form but an error message has appeared beside the form.
"test.php"
Check out the sample file I posted in the following thread (the third code chunk in my post). It allows you to post back to the same file, and handles validation and redisplaying the form with error messages and repopulate the form with what they already entered.
A note is that the code lists all the errors at the top of the form, however, since they are in an array, indexed with the same name as the inputs, you can easily display them with their inputs instead.