Page 1 of 1

E-Mail Text Field

Posted: Tue Nov 26, 2002 2:10 pm
by RZKG23
Hello,
I have an e-mail text field on a form. I want to add a function to my PHP Formmail processor that requires the e-mail address to include an "@" and a "." How do I do this/
Ryan
RySk8er30@aol.com

Posted: Tue Nov 26, 2002 5:37 pm
by BigE
You will probably want to use REGEX for e-mail validation. But if you just want to check for the @ symbol and a peroid, use strstr() php.net/strstr Hope that helps.

Posted: Wed Nov 27, 2002 5:15 am
by twigletmac
If you check in the documentation for the regular expressions there are a few versions of e-mail validation in the user comments:
http://www.php.net/manual/en/function.preg-match.php
http://www.php.net/manual/en/function.eregi.php

Mac

Posted: Wed Nov 27, 2002 5:47 am
by Skywalker
Try to use a pease of this:



(!preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+\.([a-zA-Z]{2,3})$/"))



Greathings Skywalker