ereg(i) for form input validation for SQL - tutorial?
| From: | Simon H | Date: | Sun, 27 Jan 2002 16:12:45 +0000 |
| Subject: | ereg(i) for form input validation for SQL - tutorial? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82289@lists.php.net to get a copy of this message | ||
Does anyone know of a good tutorial for using ereg and eregi to validate
standard fields for SQL input (i'm using PearDB). Typically the type of
validation that I think I need would be, firstly to detect invalid
characters, or special characters, or things that can screw up the SQL
Query. Others would be the alpha only, string lengths, email address, dates
and times, phone numbers.
These are standard items in a lot of systems...surely there's a tutorial out
there somewhere, or a sample script or something. I've only just discovered
regex, so its all a bit hmmmmmmmm at the moment.
Any links for tutorials or sample scripts would be much appreciated.
Thanks
Simon H