我在下面有我的代码,我能够验证域但即使域名有效也无法验证用户名。
例如:
mon@hotmail.com --- valid domain valid username ---- pass
aksjdsk@hotmail.com ----- valid domain invalid username ---- failed
如果有人可以提供帮助,我们将不胜感激。
function domain_exists($email, $record = 'MX'){
list($user, $domain) = preg_split('/@/', $email);
return checkdnsrr($domain, $record);}
if(!domain_exists($email)){
echo "<script type='text/javascript'>window.alert('No have such email,invalid Domain. please enter valid email address!')</script>";
echo "<script type='text/javascript'>window.location='register.html'</script>";
exit;}
function user_exists($email, $record = 'MX'){
list($user, $domain) = preg_split('/@/', $email);
return checkdnsrr($user, $record);}
if(!user_exists($email)){
echo "<script type='text/javascript'>window.alert('No have such user, please enter valid email address!')</script>";
echo "<script type='text/javascript'>window.location='register.html'</script>";
exit;}