...

View Full Version : email validation not working properly



shajiuddin
04-12-2012, 09:51 AM
Hi,

I am checking email validation using this code

if (!preg_match("/^([a-zA-Z0-9])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/", $email1))
{$messages[] = "Email ID is required field / Please enter correct Email ID."; }

but when I put '_' under email address like (test_1@hotmail.com) it's showing error that Email ID is required field / Please enter correct Email ID.

How can I enable '_' in this code for email address please help

gvre
04-12-2012, 01:38 PM
if (!preg_match("/^([a-zA-Z0-9_])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/", $email1))



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum