I'd like to do some security and common sense checks on my site. The user submits a form that inserts their information into a database. I's like to make certain that the first name contains letters only, and the phone number numbers only.
So,
1) How do I check a string for letters only? 2) How do I check for numbers only?
I'm sure this is pretty standard, but I've never done it before. Any help is greatly appreciated.
ahmedtheking
5:12 pm on Jan 4, 2007 (gmt 0)
ok mate, some nice reading for you, check out preg_match on php.net: [uk.php.net...]
barns101
5:23 pm on Jan 4, 2007 (gmt 0)
Also, when inserting user-submitted data into a (presumably MySQL) database, remember to use mysql_real_escape_string [php.net].