php用于检查URL和电子邮件检查

来源:互联网 发布:网络布线系统图 编辑:程序博客网 时间:2024/06/10 10:38
<!DOCTYPE html><html><head><title>Site submission results</title><meta charset="utf-8"></head><body><?php$url = $_REQUEST['url'];$email = $_REQUEST['email'];$url = parse_url($url);//返回包含url不同部分的相关数组$host = $url['host'];//主机if(!($ip = gethostbyname($host))){echo 'Host for URL does not have valid IP';exit;}echo '主机IP是' . $ip . "<br />";$email = explode('@', $email);$emailhost = $email[1];if(!dns_get_mx($emailhost, $mxhostsarr)){echo 'Email address is not valid host';exit;}echo '邮件交换记录';foreach($mxhostsarr as $mx){echo $mx . ' ';}?></body></html>


0 0
原创粉丝点击