This doesn't check if the email exists but it should validate it:
PHP Code:
function is_valid_email($email){
if(preg_match("/[a-zA-Z0-9_\-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email) > 0){
return true;
}else{
return false;
}
}
[edit]
Here's a code to see if the myemail@gmail.com is a valid(the site):
PHP Code:
function is_real_site($email){
$email = preg_split("/[@]+/", $email);
$ip = $email[1];
exec("ping -n 4 $ip 2>&1", $output, $retval);
if ($retval != 0) {
$check = false;
} else {
$check = true;
}
return $check;
}
If so the function will return "1."
Inspired by: http://www.dynamicdrive.com/forums/s...85&postcount=1
Edit: BUG IN ABOVE CODE! Someone could type: shutdown in the email address, and the server would shut down.
Bookmarks