Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-12-2012, 09:51 AM   PM User | #1
shajiuddin
New Coder

 
Join Date: Sep 2011
Posts: 69
Thanks: 6
Thanked 0 Times in 0 Posts
shajiuddin is an unknown quantity at this point
email validation not working properly

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
shajiuddin is offline   Reply With Quote
Old 04-12-2012, 01:38 PM   PM User | #2
gvre
Regular Coder

 
Join Date: May 2011
Posts: 214
Thanks: 1
Thanked 50 Times in 49 Posts
gvre is an unknown quantity at this point
if (!preg_match("/^([a-zA-Z0-9_])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/", $email1))
gvre is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:52 AM.


Advertisement
Log in to turn off these ads.