■ 網址查詢和申請

網址查詢
www.

域 名 查 詢 結 果
67){ $domainok=0;} } else{ if(strlen($domain)>22){ $domainok=0;} } if($domainok==1){ // 確認WHOIS主機 $nic="whois.internic.net"; $lastclip=substr(strrchr($url,"."),1); switch($lastclip){ case "cn": $nic="whois.cnnic.net.cn"; if(preg_match("/.edu.cn/",$url)){ $nic="whois.nic.edu.cn"; } break; case "mil": $nic="whois.nic.mil"; break; case "gov": $nic="whois.nic.gov"; break; case "us": $nic="whois.isi.edu"; break; case "mx": $nic="whois.nic.mx"; break; case "ca": $nic="whois.cdnnet.ca"; break; case "uk": $nic="whois.ripe.net"; break; case "dk": $nic="whois.ripe.net"; break; case "de": $nic="whois.ripe.net"; break; case "be": $nic="whois.ripe.net"; break; case "at": $nic="whois.ripe.net"; break; case "cz": $nic="whois.ripe.net"; break; case "fr": $nic="whois.nic.fr"; break; case "ch": $nic="whois.nic.ch"; break; case "au": $nic="whois.aunic.net"; break; } if($nic=="whois.internic.net"){ $fp = fsockopen("whois.internic.net", 43, &$errno, &$errstr, 10); if(!$fp) { echo "$errstr ($errno)
\n"; } else { fputs($fp,"$url\n\n"); while(!feof($fp)) { $newline=fgets($fp,256); $allinfo=$allinfo.$newline; if(preg_match("/Whois Server:/",$newline)){ $whoisline=explode(":",$newline); $nic=trim($whoisline[1]); break; } } fclose($fp); } } if($nic=="whois.cnnic.net.cn"){ $fp = fsockopen("whois.cnnic.net.cn", 43, &$errno, &$errstr, 10); if(!$fp) { echo "$errstr ($errno)
\n"; } else { fputs($fp,"$url\n\n"); while(!feof($fp)) { $newline=fgets($fp,256); $allinfo=$allinfo.$newline; } fclose($fp); } } if($nic=="whois.nic.edu.cn"){ $fp = fsockopen("whois.nic.edu.cn", 43, &$errno, &$errstr, 10); if(!$fp) { echo "$errstr ($errno)
\n"; } else { fputs($fp,"$url\n\n"); while(!feof($fp)) { $newline=fgets($fp,256); $allinfo=$allinfo.$newline; } fclose($fp); } } if(preg_match("/沒有找到你所要查找的記錄/",$allinfo)||preg_match("/No entries found for/",$allinfo)||preg_match("/No match for/",$allinfo)){ echo "恭喜您!

網址"."\"".$url."\""."尚未被其他人註冊!

如果您需要註冊該網址,

點這裡自動送出申請"; } else{ echo "很遺憾!

網址"."\"".$url."\"已被其他人註冊!

"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; } } else{ echo "對不起,您沒有輸入需查詢的網址或網址輸入錯誤!

\n"; echo "網址的使用規則:
"; echo "□ 只允許使用字母、數字和橫線
"; echo "□ 不能以橫線開始或結束
"; echo "□ .com,.net,.org網址不得超過67字節
"; echo "□ 網址大小寫不敏感
"; echo "□ 網址不得包含空格
"; echo "
返回\n"; } ?>