You are here: ereg statements « All PHP « IT news, forums, messages
ereg statements

Posted by Cerebral Believer on 10/11/24 12:00

Is this a good ereg statement?

if
(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{1,})*\.([a-z]{2,}){1}$",$email_1
or $email_2))
{
unset($_GET['do']);
$message_new = "<font color='#cc0000'>$email_1 or $email_2 is not a
valid email address.
Please try again.</font>";
include("login_form.php");
exit();

I am just trying to check if the e-mail fields _1 & _2 on the form contain
valid characters, without getting to complicated. The form I am using it in
keeps returning that I am not entering a valid e-mail address, such
"chris.bolton@ntlworld.com", or "chris@myweb.co.uk",or "chris@ntlworld.com"
not sure why this is the case?

Regards,
C.B.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация