NYCPHP Meetup

NYPHP.org

[nycphp-talk] validating email address

selyah selyah1 at yahoo.com
Fri Dec 14 11:09:57 EST 2007


thanks, that works










----- Original Message ----
From: Ben Sgro <ben at projectskyline.com>
To: NYPHP Talk <talk at lists.nyphp.org>
Sent: Friday, December 14, 2007 11:05:53 AM
Subject: Re: [nycphp-talk] validating email address


if (!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-]
 
)+( [a-zA-Z0-9\._-] +)+$/" , $email))

selyah wrote:
> Hello all:
> I have created a database which is working fine and i am now 
> validating the inputted data.   I am stuck on validating the email 
> address.  I am using the  validating statement below, and it is not 
> working.  when i enter the email incorrectly, it is still entered
 into 
> the database, and the errror msg is not printed.  can anyone see the 
> error of my ways.  thanks
>
 |if(||eregi||(||"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"||, $_POST['email']||||)) {|
> |  echo ||"Valid email address."||;|
> |  }|
> |else {|
> |  echo ||"Invalid email address."||;|
> |}|
> *//*
>
>
>
 ------------------------------------------------------------------------
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071214/72082426/attachment.html>


More information about the talk mailing list