php-db | 2004071
Date: 07/14/04
- Next message: Ignatius Reilly: "Re: [PHP-DB] PHP sitemap"
- Previous message: John W. Holmes: "[PHP-DB] Re: [PHP] Grab a range of rows from a mysql result"
- In reply to: Jensen, Kimberlee: "[PHP-DB] Validate value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thank you, Very much.... !!!
It worked fine.
Regards,
Rinku
"Jensen, Kimberlee" <KJensen <email protected>> wrote:
1. You have to allow for a space in your pattern - you can do so by hitting the space bar or using \s. Here are some options
$pattern="/^[a-zA-Z ]+$/";
if(preg_match($pattern,$_POST['name']))
{
$pattern="/^[a-zA-Z\s]+$/";
if(preg_match($pattern,$_POST['name']))
{
$pattern="/^[a-zA-Z]+[\s]?[a-zA-Z]*$/";
if(preg_match($pattern,$_POST['name']))
{
2. Do you want other characters besides numbers in the phone, such as 333-333-3333?
Otherwise, this should do it:
$pattern="/^[\d]{10}$/";
if(preg_match($pattern,$_POST['phone']))
{
---------------------------------
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
- Next message: Ignatius Reilly: "Re: [PHP-DB] PHP sitemap"
- Previous message: John W. Holmes: "[PHP-DB] Re: [PHP] Grab a range of rows from a mysql result"
- In reply to: Jensen, Kimberlee: "[PHP-DB] Validate value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

