Email Address Validation Function PHP Code Form HTML Check Correct Valid
email address validation function php code form html check correct valid
email, address, validation, function, php, code, form, html, check, correct, valid
Email Address Validation Function PHP Code Form HTML Check Correct Valid
Post Description: email address validation function php code form html check correct valid
POST# 1056
Posted On: Fri Feb 29, 2008 12:01 pm
pack
Topic: Email Address Validation Function PHP Code Form HTML Check Correct Valid
im writing a script with a form and i want to write a piece of code that will check for a valid email address using php programming, but i am not very familiar with the syntax, i was wondering if you guys can help me figure out how i can write a snippet of a function which verifies and confirms that the email address entered by a user on an HTML form is correct and valid. so basically i need a PHP email vadliation function i can use.
Share:
BBCODE:
HTML Code:


Thu Jun 21, 2007 6:09 pm
1
wahoo
Reply #1779
try this function:

CODE:
function check_email($email) {
$validation = TRUE;
if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$", $email)) {
$validation = FALSE;
}
return $validation;
}


What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload