RE: [PHP] Checking for and @ and a .
| From: | James Hallam | Date: | Wed, 27 Feb 2002 19:26:20 +0000 |
| Subject: | RE: [PHP] Checking for and @ and a . | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-86459@lists.php.net to get a copy of this message | ||
Use a regular expression to test the variable submitted by the form. This
is an excerpt from my usual validation script using ereg().. I'm sure you
can adapt this for your purposes..
if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email_address)) {
$send = "no";
}
HTH
james
-----Original Message-----
From: Philip J. Newman [mailto:newmanpj@philipsdomain.com]
Sent: Wednesday, February 27, 2002 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] Checking for and @ and a .
I'm trying to make an email field and I would like to check that its valid
by checking for an @ and a . can someone point me in the right direction for
this.
THanks
Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
info@philipsdomain.com
Phone: +64 25 6144012
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php