无数据库的详细域名查询程序PHP版(1)

文件一:index.php ?php echo !– Powered by MWhois written by Matt Wilson
matt@mattsscripts.co.uk –//n/; /*
#########################################################################################
## #本域名询问系统由mydowns搜聚收拾汉化,汉化归把握时间网址有着(卡塔尔#
#该程序是二零零三年三月19日颁发的风靡版本,本站将对此程序继续实行修正康健,敬请关怀本站!#
#该程序能够查询域名全部者的详细资料消息,现提供9个品种的域名以供查询!#
#示范地址:# #源程序打包下载:#
#握住时间网址提供PHP、ASP、CGI、HTML、JSP等源程序、电子教材、小说资料#
#握住时间网址把握时间论坛# #请保留此消息,多谢!# ##
#########################################################################################
MWhois – a Whois lookup script written in PHP and Perl Copyright (C)
2000 Matt Wilson This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. This program is
distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
*/ if(!isset($use_global_templates)) $use_global_templates = 1;//
whether to use the global templates $template_header = /gheader.tml/;//
the global header template $template_footer = /gfooter.tml/;// the
global footer template /* Template information stuff
—————————- The following strings in your templates are
replaced with the description; [DOMAIN] = domain searching for
[RAWOUTPUT] = the raw output of the whois query [WHOIS_SERVER] =
the whois server used [AVAIL_LIST] = a list of the available domains
(in global/wizard search mode) [UNAVAIL_LIST] = a list of the
unavailable domains (in global/wizard search mode) [ERROR_MSG] = the
error message produced [EXT] = the extension if it is set
[EXT_HTML_LIST] = a list of the extensions supported in a html list
[EXT_LIST] = a list of extensions supported parameters to the script
(no parameters brings up normal search script); show_raw=1= wherther to
show the raw output page do_wizard=1= whether the information being
passed is for the wizard domain=(string) = do a search for the domain
(string) list_exts=1= show the extensions supported page do_global=1=
goto the global search page do_mini_search=1 = just show the search
form without anything else company=(string) = used for the wizard,
needed in order to search keyword1=(string) = used for the wizard,
needed in order to search keyword2=(string) = used for the wizard,
needed in order to search If any of this is unclear, see the provided
example templates */ $template_search_mini = /searchform.tml/;//
search template $template_search = /searchmain.tml/;
$template_raw_output = /rawoutput.tml/;// raw output template
$template_available = /isavail.tml/;// template for available
$template_taken = /istaken.tml/;// template for taken $template_wizard
= /wizard.tml/;// template for the domain wizard
$template_wizard_results = /wizardres.tml/; // the output template for
the domain wizard $template_error = /error.tml/;// the template in case
of error $template_exts_list = /exts_list.tml/; $template_global =
/global.tml/; $template_global_results = /globres.tml/; $search_title
= /Let Floyd find your domain name/; $raw_output_title = /Floyd/’s Raw
WHOIS Output/; $available_title = /Floyd says Domain Name Available!/;
$taken_title = /Floyd says Doman Name in use/; $wizard_title = /Floyd
the Domain Name Wizard/; $error_title = /Floyd Encountered an Error!/;
$exts_list_title = /Floyd supports the following extensions/;
$global_title = /Let Floyd do the hard work!/; // the extensions that
we are going to be using, edit these for your needs $whois_exts =
array( /com/, /net/, /org/, /com.cn/, /net.cn/, /org.cn/, /gov.cn/,
/sh/, /cc/ ); // some extensions (com/net/org) have a server which
contains the name of the server which should be used forthe information,
this simply tells the script to use the whois server as a source for the
server info… 😉 $whois_si_servers = array(); // an array of the
`whois/’ servers $whois_servers = array(); // default whois servers
for info $whois_info_servers = array(); // the backup whois servers to
try $whois_info_servers_backup = array(); // the strings that are
returned if the domain is available $whois_avail_strings = array(); //
some substitution strings follow $errormsg = //; $titlebar = /MWhois
written by Matt Wilson/;// the defatul title bar $rawoutput = //; $avail
= array(); $unavail = array(); $whois_server = //; // the name of the
script $script_name = /index.php/; function
my_in_array($val,$array_) { for($l=0; $lsizeof($array_); $l++)
if($array_[$l] == $val) return 1; return 0; } // this loads the
server info for the extensions in $whois_exts; function
load_server_info() { global $whois_exts; global $whois_si_servers;
global $whois_servers; global $whois_info_servers; global
$whois_info_servers_backup; global $whois_avail_strings; // load
the servers.lst file $tlds = file(/servers.lst/); for($l=0;
$lsizeof($tlds); $l++){ // time leading spaces or trailing spaces
$tlds[$l] = chop($tlds[$l]); // filter out the commented lines
(begin with #) if(substr($tlds[$l], 0, 1) == /#/ ||
!strlen($tlds[$l])) { continue; } // explode via the seperation char
`|/’ $es = explode(/|/, $tlds[$l]); // check to see whether we want
this TLD if(!my_in_array($es[0], $whois_exts)) { continue; } // yes
we do, so store the details in the appropriate arrays
$whois_servers[$es[0]] = $es[1]; $whois_si_servers[$es[0]]
= $es[5]; $whois_info_servers[$es[0]] = $es[3];
$whois_info_servers_backup[$es[0]] = $es[4];
$whois_avail_strings[$es[1]] = $es[2]; // thats it! } } function
choose_info_server($domain, $ext) { global $whois_info_servers;
global $whois_si_servers; global $whois_server; global
$whois_servers; $whois_server = //; if($whois_si_servers[$ext]){
if(($co = fsockopen($whois_servers[$ext], 43)) == false){ echo /!–
choose_info_server() : unable to connect to
/.$whois_servers[$ext]./ @ line#/.$__LINE__./ –//n/;
$whois_server = $whois_servers[$ext]; } else { echo /!–
choose_info_servers() : connected to /.$whois_servers[$ext]./ @
line#/.$__LINE__./, looking for `/.$whois_si_servers[$ext].//’
–//n/; fputs($co, $domain././.$ext.///n/); while(!feof($co)) $output .=
fgets($co,128); fclose($co); $he = strpos($output,
$whois_si_servers[$ext]) + strlen($whois_si_servers[$ext]); $le
= strpos($output, ///n/, $he); $whois_server = substr($output, $he,
$le-$he); echo /!– choose_info_servers() : found
`/.$whois_server.//’ @ line #/.$__LINE__./,using for whois info
server –//n/; } } else { $whois_server =
$whois_info_servers[$ext]; } $whois_server = trim($whois_server);
} // make all the changes function make_changes($fil) { global $domain;
global $errormsg; global $titlebar; global $rawoutput; global $avail;
global $unavail; global $ext; global $whois_exts; global
$whois_servers; global $script_name; $f = implode(//,file($fil)); $f =
str_replace(/[WHOIS_SERVER]/,$whois_servers[$ext],$f); $f =
str_replace(/[TITLE_BAR]/,$titlebar,$f); $f =
str_replace(/[DOMAIN]/,$domain,$f); $f =
str_replace(/[ERROR_MSG]/,$errormsg,$f); $f =
str_replace(/[RAWOUTPUT]/,$rawoutput,$f); for($l=0; $lsizeof($avail);
$l++){ $sp[1] = substr(strchr($avail[$l],/./),1); $sp[0] =
substr($avail[$l],0,strlen($avail[$l])-strlen($sp[1])-1);
$avail_s =
$avail_s./ahref=////.$script_name./?domain=/.$sp[0]./&ext=/.$sp[1]./////.$avail[$l].//abr/;
} for($l=0; $lsizeof($unavail); $l++){ $sp[1] =
substr(strchr($unavail[$l],/./),1); $sp[0] =
substr($unavail[$l],0,strlen($unavail[$l])-strlen($sp[1])-1);
$unavail_s =
$unavail_s./ahref=////.$script_name./?domain=/.$sp[0]./&ext=/.$sp[1]./////.$unavail[$l].//abr/;
} $f = str_replace(/[AVAIL_LIST]/,$avail_s,$f); $f =
str_replace(/[UNAVAIL_LIST]/,$unavail_s,$f); $f =
str_replace(/[SCRIPT_NAME]/, $script_name, $f); $f =
str_replace(/[EXT]/,$ext,$f); $f =
str_replace(/[EXT_LIST]/,implode(/br/,$whois_exts),$f); $f =
str_replace(/[EXT_HTML_LIST]/,/selectname=ext//noption/.implode(///noption/,$whois_exts).///n/select/,$f);
return $f; } // show the error page function do_error() { global
$use_global_templates; global $template_header; global
$template_footer; global $template_error; global $domain; global
$titlebar; global $error_title; global $errormsg; $titlebar =
$error_title; if($use_global_templates) echo
make_changes($template_header); echo make_changes($template_error);
if($use_global_templates) echo make_changes($template_footer);
exit(); } // checks the domain is legal function check_domain() {
global $errormsg; global $domain; global $ext; global $whois_exts;
if(isset($ext)){ if(!strlen($ext卡塔尔国卡塔尔(قطر‎{ $errormsg = /未有选拔域名后缀/;
return 0; } if(!my_in_array($ext,$whois_extsState of Qatar卡塔尔国{ $errormsg =
/不扶植此域名后缀/; return 0; } } if(isset($domain卡塔尔卡塔尔(قطر‎{ if(strlen($domainState of Qatar2 || strlen($domain卡塔尔(قطر‎ 57卡塔尔国{ $errormsg = /域名太长或太短/; return 0; }
if(strlen($domain卡塔尔(قطر‎ == 2 && !ereg(/([0-9]卡塔尔国{2}/,$domain卡塔尔(قطر‎State of Qatar{ $errormsg =
/在2个字节的域名中不可能富含有字母/; return 0; }
if(ereg(/^-|-$/,$domainState of Qatar卡塔尔(قطر‎{ $errormsg =
/域名前和域名后不可能动用-,也不能接连使用-/; return 0; }
if(!ereg(/([a-z]|[A-Z]|[0-9]|-State of Qatar{/.strlen($domain卡塔尔国./}/,$domainState of Qatar卡塔尔{
$errormsg = /域名只可以够分包字母数字构成和-/; return 0; } } return 1; }
// perform_whois function returns 0 if domain is available otherwise
returns either the raw info or 1 function
perform_whois($domainname,$ext,$raw) { global $errormsg; global
$whois_servers; global $rawoutput; global $whois_avail_strings;
$rawoutput = //; if($raw) return do_raw($domainname,$ext); if(($ns =
fsockopen($whois_servers[$ext],43卡塔尔国State of Qatar == false卡塔尔(قطر‎{ $errormsg =
/无法连接到域名查询服务器 bi/.$whois_servers[$ext].//i/b/; return -1;
} fputs($ns,/$domainname.$ext//n/); while(!feof($ns)) $rawoutput .=
fgets($ns,128); fclose($ns); echo /!–//nAvail string =
////.$whois_avail_strings[$whois_servers[$ext]].//////nComparing
against =////.$rawoutput.//////n–//n/;
if(!ereg($whois_avail_strings[$whois_servers[$ext]], $rawoutput))
return 0; return 1; } // this performs the whois lookup and then shows
the data returned function do_raw($domainname, $ext) { global
$titlebar; global $template_raw_output; global
$use_global_templates; global $template_header; global
$template_footer; global $raw_output_title; global
$whois_info_servers; global $whois_servers; global $rawoutput; global
$errormsg; global $whois_info_servers_backup; global
$whois_avail_strings; global $whois_server;
choose_info_server($domainname, $ext); if(($ns =
fsockopen($whois_server,43)) == false){ if(($ns =
fsockopen($whois_info_servers[$ext],43)) == false){ if(($ns =
fsockopen($whois_info_servers_backup[$ext], 43)) == false){ return
-1; } else { $whois_server = $whois_info_servers_backup[$ext]; } }
else { $whois_server = $whois_info_servers[$ext]; } } print /!–
do_raw() : using `/.$whois_server.//’ for whois query –//n/;
fputs($ns,/$domainname.$ext//n/); while(!feof($ns)) $rawoutput =
$rawoutput.fgets($ns,128); fclose($ns); echo /!–/.$rawoutput./–/;
//$pos = @strpos($rawoutput,$whois_avail_strings[$server]);
//if(is_string($pos) && !$pos){} //else{ //if(!is_string($pos) ||
$pos){ //if(($ns = fsockopen($whois_info_servers_backup[$ext],43))
== false) //return -1; //else{ //$rawoutput = //;
//fputs($ns,/$domainname.$ext//n/); //while(!feof($ns)) //$rawoutput =
$rawoutput.fgets($ns,128); //$pos =
@strpos($rawoutput,$whois_avail_strings[$whois_info_servers_backup[$ext]]);
//if(!is_string($pos) || $pos){} //else //return -1; //} //} $titlebar
= $raw_output_title; if($use_global_templates) echo
make_changes($template_header); echo
make_changes($template_raw_output); if($use_global_templates) echo
make_changes($template_footer); exit(); } function
do_getsearch_mini() { global $template_search_mini; echo
make_changes($template_search_mini); exit(); } function
do_getsearch() { global $template_footer; global $template_header;
global $use_global_templates; global $titlebar; global
$template_search; global $search_title; $titlebar = $search_title;
if($use_global_templates) echo make_changes($template_header); echo
make_changes($template_search); if($use_global_templates) echo
make_changes($template_footer); exit();} function do_avail() { global
$template_footer; global $template_header; global
$use_global_templates; global $titlebar; global $template_available;
global $available_title; $titlebar = $available_title;
if($use_global_templates) echo make_changes($template_header); echo
make_changes($template_available); if($use_global_templates) echo
make_changes($template_footer); exit(); } function do_taken() {
global $template_footer; global $template_header; global
$use_global_templates; global $template_taken; global $titlebar;
global $taken_title; $titlebar = $taken_title;
if($use_global_templates) echo make_changes($template_header); echo
make_changes($template_taken); if($use_global_templates) echo
make_changes($template_footer); exit(); } function do_exts() { global
$template_footer; global $template_header; global
$use_global_templates; global $template_exts_list; global $titlebar;
global $exts_list_title; $titlebar = $exts_list_title;
if($use_global_templates) echo make_changes($template_header); echo
make_changes($template_exts_list); if($use_global_templates) echo
make_changes($template_footer); exit(); } function do_glob() { global
$domain; global $whois_exts; global $avail; global $unavail; global
$template_header; global $template_footer; global
$use_global_templates; global $titlebar; global $global_title;
$titlebar = $global_title; if($use_global_templates) echo
make_changes($template_header); if(!isset($domain)){ global
$template_global; echo make_changes($template_global); } else{ global
$template_global_results; for($l=0; $lsizeof($whois_exts); $l++){
if(($r = perform_whois($domain,$whois_exts[$l],0)) != -1){ if(!$r)
$avail[] = $domain././.$whois_exts[$l]; else $unavail[] =
$domain././.$whois_exts[$l]; } } echo
make_changes($template_global_results); } if($use_global_templates)
echo make_changes($template_footer); exit(); } function do_wiz() {
global $domain; global $ext; global $avail; global $unavail; global
$template_header; global $template_footer; global
$use_global_templates; global $titlebar; global $wizard_title; global
$errormsg; global $keyword1; global $keyword2; global $company;
$titlebar = $wizard_title; if($use_global_templates) echo
make_changes($template_header); if(!isset($company) ||
!isset($keyword1) || !isset($keyword2)){ global $template_wizard; echo
make_changes($template_wizard); } else{ global
$template_wizard_results; $domains = array( $company,
$company.$keyword1, $company./-/.$keyword1, $keyword1.$company,
$keyword1./-/.$company, $company.$keyword2, $company./-/.$keyword2,
$keyword2.$company, $keyword2./-/.$company, $keyword1, $keyword2,
$keyword1.$keyword2, $keyword2.$keyword1, $keyword1./-/.$keyword2,
$keyword2./-/.$keyword1 ); for($l=0; $lsizeof($domains); $l++){ $domain
= strtolower(str_replace(/ /,//,$domains[$l])); if(check_domain()){
if(($r = perform_whois($domain,$ext,0)) != -1){ if(!$r) $avail[] =
$domain././.$ext; else $unavail[] = $domain././.$ext; } } } echo
make_changes($template_wizard_results); } if($use_global_templates)
echo make_changes($template_footer); exit(); } load_server_info();
if(!check_domain()) do_error(); if(isset($do_wizard)) do_wiz();
if(isset($do_global)) do_glob(); if(isset($list_exts)) do_exts();
if(isset($do_mini_search)) do_getsearch_mini(); if(!isset($domain))
do_getsearch(); if(isset($show_raw)){
if(perform_whois($domain,$ext,1) != -1State of Qatar $errormsg =
/MWhois域名查询内部错误/; do_error(); } $ret =
perform_whois($domain,$ext,0); if($ret == -1) do_error(); if(!$ret)
do_taken(); else do_avail(); ?

当我们利用PHP的时候,假如您本人有一点特别有效的方法可能代码片段,那么将会给您带来相当大的便利。几日前我们将介绍拾一个顶级好用的PHP代码片段,希望大家能够赏识!
使用textmagic API来发送消息可能临时,你要求发送一些短信到您顾客手提式无线话机上,你相对应该看看textMagic。他们提供非常轻易的API来贯彻那个作用。然则还是不是无需付费的啊。
// Include the TextMagic PHP
librequire(‘textmagic-sms-api-php/TextMagicAPI.php’卡塔尔(قطر‎;// Set the username
and password information$username = ‘myusername’;$password =
‘mypassword’;// Create a new instance of TM$router = new
TextMagicAPI(array( ‘username’ => $username, ‘password’ =>
$password卡塔尔国卡塔尔国;// Send a text message to ‘999-123-4567’$result =
$router->send(‘Wake up!’, array(9991234567), true);// result: Result
is: Array ( [messages] => Array ( [19896128] => 9991234567 )
[sent_text] => Wake up! [parts_count] => 1 )来源:
通过IP来判定来源
这是叁个那三个实用的代码片段帮助你通过IP来剖断地方。上面包车型客车情势采用三个参数,然后回来IP所在地点。若无找到,则重回UNKNOWN。
function detect_city($ip) { $default = ‘UNKNOWN’; if (!is_string($ip)
|| strlen($ip) < 1 || $ip == ‘127.0.0.1’ || $ip == ‘localhost’) $ip =
‘8.8.8.8’; $curlopt_useragent = ‘Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)’;
$url = ” . urlencode($ip); $ch =
curl_init(); $curl_opt = array( CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_HEADER => 0, CURLOPT_RETURNTRANSFER => 1,
CURLOPT_USERAGENT => $curlopt_useragent, CURLOPT_URL => $url,
CURLOPT_TIMEOUT => 1, CURLOPT_REFERER => ‘http://’ .
$_SERVER[‘HTTP_HOST’], ); curl_setopt_array($ch, $curl_opt);
$content = curl_exec($ch); if (!is_null($curl_info)) { $curl_info =
curl_getinfo($ch); } curl_close($ch); if ( preg_match(‘{

City : ([^}i’, $content, $regs) ) { $city = $regs[1]; } if (
preg_match(‘{

State/Province : ([^}i’, $content, $regs) ) { $state = $regs[1]; }
if( $city!=” && $state!=” ){ $location = $city . ‘, ‘ . $state; return
$location; }else{ return $default; }}来源:

显示其它网页的源代码
是否想体现带有行号的别的网页的源代码?这里有个简单的代码片段。只要改正第二行的url就能够

$line) { // loop thru each line and prepend line numbers echo “Line
#{$line_num} : ” . htmlspecialchars($line) . “
n”;}来源:

判别服务器是不是HTTPS
需求推断代码运转意况是还是不是HTTPS服务器?上面代码能够帮助您兑现,非常轻巧!
if ($_SERVER[‘HTTPS’] != “on”) { echo “This is not HTTPS”;}else{ echo
“This is HTTPS”;}来源:

在完全的公文中呈现推文(Tweet卡塔尔国(照片墙State of Qatar的客官想看看你在facebook有稍许客官么?下边代码能够协助您兑现 function
fb_fan_count($facebook_name){ // Example:
$data =
json_decode(file_get_contents(“));
echo $data->likes;}来源:
推断二个图片的主色调
上面这么些代码极其实用,能协理您认清二个图形中的主色调,你能够解析任何图片。
$i = imagecreatefromjpeg(“image.jpg”卡塔尔;for ($x=0;$x> 16State of Qatar & 0xFF; $g =
($rgb >> & 0xFF; $b = $rgb & 0xFF; $rTotal += $r; $gTotal += $g;
$bTotal += $b; $total++; }}$rAverage = round($rTotal/$total卡塔尔国;$gAverage =
round($gTotal/$total卡塔尔国;$bAverage = round($bTotal/$totalState of Qatar;来源:
领悟您的内部存款和储蓄器使用意况为了优化你的脚本,你早晚须求通晓您的服务器上的RAM使用数据。这一个代码片段将资助你打探内部存款和储蓄器使用,而且打字与印刷开始,最后,及其峰值使用境况echo “Initial: “.memory_get_usage().” bytes n”;/* printsInitial:
361400 bytes*/// let’s use up some memoryfor ($i = 0; $i < 100000;
$i++) { $array []= md5($i);}// let’s remove half of the arrayfor ($i =
0; $i < 100000; $i++) { unset($array[$i]);}echo “Final:
“.memory_get_usage().” bytes n”;/* printsFinal: 885912 bytes*/echo
“Peak: “.memory_get_peak_usage().” bytes n”;/* printsPeak:
13687072 bytes*/来源:

使用gzcompress(State of Qatar来减量当使用string时,往往会十分的长。使用gzcompress(卡塔尔方法,strings可以被压缩,解压缩使用gzuncompress(卡塔尔国就可以,如下:
$string =”Lorem ipsum dolor sit amet, consecteturadipiscing elit. Nunc
ut elit id mi ultriciesadipiscing. Nulla facilisi. Praesent
pulvinar,sapien vel feugiat vestibulum, nulla dui pretium orci,non
ultricies elit lacus quis ante. Lorem ipsum dolorsit amet, consectetur
adipiscing elit. Aliquampretium ullamcorper urna quis iaculis. Etiam ac
massased turpis tempor luctus. Curabitur sed nibh eu elitmollis congue.
Praesent ipsum diam, consectetur vitaeornare a, aliquam a nunc. In id
magna pellentesquetellus posuere adipiscing. Sed non mi metus, at
laciniaaugue. Sed magna nisi, ornare in mollis in, mollissed nunc. Etiam
at justo in leo congue mollis.Nullam in neque eget metus hendrerit
scelerisqueeu non enim. Ut malesuada lacus eu nulla bibendumid euismod
urna sodales. “;$compressed = gzcompress($string卡塔尔国;echo “Original size:
“. strlen($stringState of Qatar.”n”;/* printsOriginal size: 800*/echo “Compressed
size: “. strlen($compressed).”n”;/* printsCompressed size: 418*///
getting it back$original = gzuncompress($compressed);来源:

使用PHP来实施Whois查询
要是您须要获得钦点域名的whois音信,为啥不利用PHP呢?上面方法能够协理我们:
function whois_query($domain) { // fix the domain name: $domain =
strtolower(trim($domain)); $domain = preg_replace(‘/^http:///i’,
”, $domain); $domain = preg_replace(‘/^www./i’, ”, $domain);
$domain = explode(‘/’, $domain); $domain = trim($domain[0]); // split
the TLD from domain name $_domain = explode(‘.’, $domain); $lst =
count($_domain)-1; $ext = $_domain[$lst]; // You find resources and
lists // like these on wikipedia: // //
// $servers = array( “biz” =>
“whois.neulevel.biz”, “com” => “whois.internic.net”, “us” =>
“whois.nic.us”, “coop” => “whois.nic.coop”, “info” =>
“whois.nic.info”, “name” => “whois.nic.name”, “net” =>
“whois.internic.net”, “gov” => “whois.nic.gov”, “edu” =>
“whois.internic.net”, “mil” => “rs.internic.net”, “int” =>
“whois.iana.org”, “ac” => “whois.nic.ac”, “ae” =>
“whois.uaenic.ae”, “at” => “whois.ripe.net”, “au” =>
“whois.aunic.net”, “be” => “whois.dns.be”, “bg” =>
“whois.ripe.net”, “br” => “whois.registro.br”, “bz” =>
“whois.belizenic.bz”, “ca” => “whois.cira.ca”, “cc” =>
“whois.nic.cc”, “ch” => “whois.nic.ch”, “cl” => “whois.nic.cl”,
“cn” => “whois.cnnic.net.cn”, “cz” => “whois.nic.cz”, “de” =>
“whois.nic.de”, “fr” => “whois.nic.fr”, “hu” => “whois.nic.hu”,
“ie” => “whois.domainregistry.ie”, “il” => “whois.isoc.org.il”,
“in” => “whois.ncst.ernet.in”, “ir” => “whois.nic.ir”, “mc” =>
“whois.ripe.net”, “to” => “whois.tonic.to”, “tv” => “whois.tv”,
“ru” => “whois.ripn.net”, “org” => “whois.pir.org”, “aero” =>
“whois.information.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;}来源:

不显得PHP错误而发送电子邮件代替之
有个别时候你不想突显PHP错误,而给您发送叁个email,下边代码能够支持你达成:

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图