I know I have seen it somewhere on this site but I need the code to be able to control the kind of information being passed in a form.
ie.
enter your birthdate: jeff
error message: that is not a birthdate, goofball.
thanks for the help
Controlling Forms
Moderator: General Moderators
- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
this is standard form validation .. usually this is processed via a POST request sent by the browser .. there are many functions which can be useful, but the one you will probably want to learn is preg_match()
http://www.php.net/manual/en/function.preg-match.php
http://www.php.net/manual/en/function.preg-match.php
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Well then, check out the is_something() functions. To start you off here's one that will check that a given value is numeric:
http://www.php.net/manual/en/function.is-numeric.php
Also as Protokol said the preg_match() function will be very useful too.
Mac
http://www.php.net/manual/en/function.is-numeric.php
Also as Protokol said the preg_match() function will be very useful too.
Mac