PDA

For continued disscussion on this topic : Checking for proper formated email (form using PHP)



George W. Bush
05-08-2001, 06:49 PM
if(!eregi("^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$", $Email))

the above code will check for a properly formated email address in an email field (from a form)

I am not too sure what will I have to do to allow only email with the hotmail.com extension

perhaps?

if(!eregi("^([._a-z0-9-]+[._a-z0-9-]*)@(hotmail.com)$", $Email))

I am not too sure...

gzazJim
05-08-2001, 07:18 PM
Hey GWB,

That LOOKS like it should work... Sorry, I'm still new to PHP here!

Regards,

Jim

George W. Bush
05-08-2001, 11:42 PM
Well, I think so... I will try it when I get some free time, and will let you know. Write it down or something just in case you want to use something like this in the future...