Domain Search

array("whois.crsnic.net","No match for"), "net" => array("whois.crsnic.net","No match for"), "org" => array("whois.pir.org","NOT FOUND"), "co.uk" => array("whois.nic.uk","No match"), "mobi" => array("whois.dotmobiregistry.net","NOT FOUND") ); ####################################### # To add definitions download Whois Lookup from my site. # Add wanted TLD's from whois-servers-list-1.0.txt => whois-servers-list.txt # Run a whois query against any dummy domain, one that you know # is not registered like scottconnell-is-the-best-programmer.yourTLD # and look for "no match" or "not found", then add that definition here. ####################################### function printForm() { global $keyword,$ext,$definitions; $action = htmlspecialchars($_SERVER["PHP_SELF"], ENT_QUOTES); $keyword = str_replace(" src", "", strtolower($keyword)); print <<

Start by entering a keyword.

ENDHTM; } if(isset($_POST['keyword']) && strlen($_POST['keyword']) > 0) { $keyword = $_POST['keyword']; // This will fix a lot of user input errors, remove if you wish. $keyword = preg_replace('/[^0-9a-zA-Z\-]/','', $keyword); if(strlen($keyword) < 2) { print "

Error: The keyword \"$keyword\" is too short.

\n"; printForm(); exit(print "\n"); } if(strlen($keyword) > 63) { print "

Error: The keyword is too long. Max 63 characters. You have ". strlen($keyword) ." characters.

\n"; printForm(); exit(print "\n"); } if(!preg_match("/^[a-zA-Z0-9\-]+$/", $keyword)) { print "

Error: Keyword cannot contain special characters.

\n"; printForm(); exit(print "\n"); } if(preg_match("/^-|-$/", $keyword)) { print "

Error: Keywords cannot begin, or end with a hyphen.

\n"; printForm(); exit(print "\n"); } printForm(); print "\n"; foreach($definitions as $key => $value) { $ext = $key; $server = $definitions[$ext][0]; $nomatch = $definitions[$ext][1]; if(!$server_conn = @fsockopen($server, 43)) { print "\n"; } else { $response = ""; fputs($server_conn, "$keyword.$ext\r\n"); while(!feof($server_conn)) { $response .= fgets($server_conn, 128); } fclose($server_conn); if(preg_match("/$nomatch/", $response)) { print "\n"; } else { print "\n"; } } } print "
ErrorCould not connect to whois server at: ". $server ."
Available$keyword.$ext
Registeredhttp://$keyword.$ext
"; } else { printForm(); } ?>