首页 > 后端开发 > php教程 > 无数据库的详细域名查询程序PHP版

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

WBOY
发布: 2016-06-01 14:29:20
原创
1027 人浏览过
文件一:index.php


echo "\n";

/*
  #########################################################################################
  #                                            #
  # 本域名查询系统由mydowns收集整理汉化,汉化归把握时间网站所有(http://www.85time.com)  #
  # 该程序是2001年5月18日发布的最新版本,本站将对此程序继续进行修改完善,敬请关注本站! #
  # 该程序可以查询域名所有者的详细资料信息,现提供9个类型的域名以供查询!        #
  # 演示地址:http://www.85time.com/whois                        #
  # 源程序打包下载:http://www.85time.com/mydowns/mydowns.php?id=378           #
  # 把握时间网站提供PHP、asp、CGI、HTML、jsp等源程序、电子教材、文章资料         #
  # 把握时间网站http://www.85time.com 把握时间论坛http://ww.85time.ent         #
  # 请保留此信息,谢谢!                                 #
  #                                            #
  #########################################################################################
  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, MA 02111-1307 USA
*/

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";  // 原始输出模板
$template_available = "isavail.tml";  // 可用
的模板 $template_taken = "istaken.tml";  // 拍摄的模板
$template_wizard = "向导.tml";  // 域向导的模板
$template_wizard_results = "wizardres.tml"; // 域向导的输出模板
$template_error = "错误.tml";  // 出现错误时的模板
$template_exts_list = "exts_list.tml";
$template_global = "global.tml";
$template_global_results = "globres.tml";

$search_title = "让弗洛伊德找到你的域名";
$raw_output_title = "弗洛伊德的原始 WHOIS 输出";
$available_title = "弗洛伊德说域名可用!";
$taken_title = "弗洛伊德说正在使用多曼名字";
$wizard_title = "域名向导弗洛伊德";
$error_title = "弗洛伊德遇到错误!";
$exts_list_title = "Floyd 支持以下扩展";
$global_title = "让弗洛伊德去努力吧!";

// 我们将要使用的扩展,根据您的需要编辑它们
$whois_exts = 数组(
  “com”,
  “网”,
  “组织”,
  "com.cn",
  "net.cn",
  "org.cn",
  "中国政府网",
  “嘘”,
  “抄送”
);

// 一些扩展(com/net/org)有一个服务器,其中包含应该用于
的服务器的名称
信息,这只是告诉脚本使用 whois 服务器作为服务器信息的来源...;)
$whois_si_servers = array();

// `whois' 服务器的数组
$whois_servers = array();

// 信息的默认 whois 服务器
$whois_info_servers = array();

// 要尝试的备份 whois 服务器
$whois_info_servers_backup = array();

// 域可用时返回的字符串
$whois_avail_strings = array();

//
之后是一些替换字符串 $errormsg = "";
$titlebar = "MWhois 由马特·威尔逊撰写";  // 默认标题栏
$原始输出=“”;
$avail = 数组();
$不可用=数组();
$whois_server = "";

// 脚本的名称
$script_name = "index.php";

函数 my_in_array($val,$array_)
{
  for($l=0; $l     if($array_[$l] == $val)
      返回1;

  返回0;
}

// 这会加载 $whois_exts 中扩展的服务器信息;
函数 load_server_info()
{
  全局 $whois_exts;
  全局$whois_si_servers;
  全局$whois_servers;
  全局$whois_info_servers;
  全局$whois_info_servers_backup;
  全局 $whois_avail_strings;
   
  // 加载servers.lst 文件
  $tlds = file("servers.lst");

  for($l=0; $l     // 时间前导空格或尾随空格
    $tlds[$l] = 砍($tlds[$l]);
     
    // 过滤掉注释行(以#开头)
    if(substr($tlds[$l], 0, 1) == "#" || !strlen($tlds[$l])) { 继续; }

    // 通过分隔符“|”进行爆炸
    $es = 爆炸("|", $tlds[$l]);

    // 检查我们是否需要这个 TLD
    if(!my_in_array($es[0], $whois_exts)) { 继续; }

    // 是的,我们这样做,所以将详细信息存储在适当的数组中
    $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];

    // 就是这样!
  }
}

函数 Choose_info_server($domain, $ext)
{
  全局$whois_info_servers;
  全局$whois_si_servers;
  全局$whois_server;
  全局$whois_servers;

  $whois_server = "";

  if($whois_si_servers[$ext]){
    if(($co = fsockopen($whois_servers[$ext], 43)) == false){
      echo "\n";
      $whois_server = $whois_servers[$ext];
    } 其他 {
      echo "\n";
      fputs($co, $domain.".".$ext."\n");
      while(!feof($co))
        $输出.= 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 "\n";
    }
  } 其他 {
    $whois_server = $whois_info_servers[$ext];
  }

  $whois_server = 修剪($whois_server);
}

// 进行所有更改
函数 make_changes($fil)
{
  全局$域;
  全局 $errormsg;
  全局$标题栏;
  全局$rawoutput;
  全球$可用;
  全局$不可用;
  全局$ext;
  全局 $whois_exts;
  全局$whois_servers;
  全局 $script_name;
   
  $f = 内爆("",文件($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; $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."
href=\"".$script_name."?domain=".$sp[0]."&ext=".$sp[1]."\">".$avail[$l]."
";
  }

   for($l=0; $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。"
href=\"".$script_name."?domain=".$sp[0]."&ext=".$sp[1]."\">".$unavail[$l]."
";
  }

  $f = str_replace("[>AVAIL_LIST   $f = str_replace("[>UNAVAIL_LIST   $f = str_replace("[>SCRIPT_NAME   $f = str_replace("[>EXT   $f = str_replace("[>EXT_LIST   $f = str_replace("[>EXT_HTML_LIST
name=ext>\n
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板