"br" => "whois.registro.br",
"bz" => "whois lizenic.bz",
"ca" => "whois.cira.ca",
"cc" => "whois.nic",
"ch" => "whois.nic.ch",
"cl" => "whois.nic.cl",
"cn" => "whoisnic ",
"cz" => "whois.nic.cz",
"de" => "whois.nic",
"fr" => "whois.nic.fr",
"hu" => "whois.nic.hu",
"ie" => "whois.domainregistry.ie",
"il" => "whois.isoc.il",
"in" => "whois.ncst.ernet.in",
"ir" => "whois.nic.ir",
"mc" => "whois.ripe ",
"to" => "whois.tonic.to",
"tv" => "whois",
"ru" => "whois.ripn ",
"org" => "whois.pir",
"aero" => "whoisrmation.aero",
"nl" => "whois.domain-registry.nl"
);
if (!isset($servers[$ext])){
die('Error: No matching nic server found!');
}
$nic_server = $servers[$ext];
$output = '';
// connect to whois server:
if ($conn = fsockopen ($nic_server, 43)) {
fputs($conn, $domain."rn");
while(!feof($conn)) {
$output .= fgets($conn,128);
}
fclose($conn);
}
else { die('Error: Could not connect to ' . $nic_server . '!'); }
return $output;
}
10. 通过Email发送PHP错误
// Our custom error handler
function nettuts_error_handler($number, $message, $file, $line, $vars){
$email = "
An error ($number) occurred on line
$line and in the file: $file.
$message
";
$email .= "
" . print_r($vars, 1) . "
";
$headers = 'Content-type: text/html; charset=iso-8859-1' . "rn";
// Email the error to someone...
error_log($email, 1, 'you@youremail', $headers);
// Make sure that you decide how to respond to errors (on the user's side)