38 // In ogni caso chiude la connessione al database
39 mysql_close($con)
40
41 function checkEmail($email){
42 // Create the syntactical validation regular expression
43 $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
44 // Presume that the email is invalid
45 $valid = 0;
46 // Validate the syntax
47 if (eregi($regexp, $email))
48 {
49 list($username,$domaintld) = split("@",$email);
50 // Validate the domain
51 if (getmxrr($domaintld,$mxrecords))
52 $valid = 1;
53 } else {
54 $valid = 0;
55 }
56 return $valid;
57 }
58 ?>




grazie