Re: Using php to verify fields in form...
| From: | Henrik Hudson | Date: | Mon, 29 Oct 2001 20:08:42 +0000 |
| Subject: | Re: Using php to verify fields in form... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72764@lists.php.net to get a copy of this message | ||
Assuming you know what your field names are, they get passed in to the PHP
script as variables.
Using regular expressions you can check your variables for values you
want/don't want. If they aren't what you want print an error message and tell
the user to go back or something similar.
It's the same process as doing it with Javascript, except its after the user
hits submit.
Henrik
On Monday 29 October 2001 11:44, Jason wrote:
> I am new to php and I have been using a book to learn a bit about it and
> well I could not find a chapter on how to use php to verify a form is
> filled out properly, for instance I have a form with 3 fields... name,
> email and words. once the user clicks the submit button i want it to verify
> those 3 fields before running the php script to pass the info to a
> database. I have used java-script for this function in the past but would
> like to use php. Anyone know how i can accomplish this? Thanks in advance,
> Jason
--
Henrik Hudson
lists@rhavenn.net