help! how to validate when i press submit

Links for php scripts

Moderators: macek, egami, gesf

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

Re: help! how to validate when i press submit

Post by freshnet » 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.

dering

Re: help! how to validate when i press submit

Post by dering » 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

Who is online

Users browsing this forum: No registered users and 1 guest