help! how to validate when i press submit

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
User avatar
php-forum Active User
php-forum Active User
Posts: 365
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Sun Sep 09, 2012 4:13 am

If you want to validate only when you submit the form, it's probably better to use $_POST variables, and perform a check on each one.


Tue Sep 18, 2012 6:22 am

As a fellow beginner programmer, I have just begun to realize the power of $_POST. It is really great when you can make it work. If you get a true on empty($_POST) then the user has not yet submitted the form. To refer to the post you have to keep in mind it is an array. In your case, I think you will want to deal with the variable $_POST["submit"] for evaluation. Also, I have found it useful to include the command print_r($_POST); at the beginning of my scripts during development to output the available variables.

Post Reply