Revision: 404
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 12, 2006 12:45 by nicolaspar
Initial Code
# validar emails con dominios validos function validateDnsEmail( $emailRaw ) { # Sacamos espacios y saltos $emailNr = eregi_replace( "\n", "", $emailRaw ); $emailNr = eregi_replace( "\r", "", $emailRaw ); $email = eregi_replace( " +", "", $emailNr ); $email = strtolower( $email ); # Lo pasamos por una regex para validar el formato if( ! eregi( "^[a-z0-9]+([_\\.-][a-z0-9]+)*". "@([a-z0-9]+([\.-][a-z0-9]+))*$", $email ) ){ # Si no es valido.... $feedback = 0;#'Error: "' . $email . '" is not a valid e-mail '; return $feedback; }else{ #Si esta ok, sacamos el dominio $item = explode( "@", $email ); $domain = $item["1"]; if ( ( gethostbyname( $domain ) == $domain ) ){ if ( gethostbyname( "www." . $domain ) == "www." . $domain ){ $feedback = 0;#'Error: "' . $domain . '" is most probably not a valid domain!'; return $feedback; } #Es Valido $feedback = 1; return $feedback; }else{ #valido $feedback = 1; return $feedback; } } }
Initial URL
Initial Description
Initial Title
Php validar email por dns beta 0.1
Initial Tags
Initial Language
PHP