热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

文件一:index.php<?phpecho"<!--PoweredbyMWhoiswrittenbyMattWilson<matt@mattsscripts.co.uk>-->\n";*################################
文件一: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\";  // 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 for 

the 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; $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; $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 \"\\n\";
      $whois_server = $whois_servers[$ext];
    } else {
      echo \"\\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 \"\\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; $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<]\",$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(\"
\",$whois_exts),$f);
  $f = str_replace(\"[>EXT_HTML_LIST<]\",\"
name=ext>\\n
推荐阅读
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 如何实现织梦DedeCms全站伪静态
    本文介绍了如何通过修改织梦DedeCms源代码来实现全站伪静态,以提高管理和SEO效果。全站伪静态可以避免重复URL的问题,同时通过使用mod_rewrite伪静态模块和.htaccess正则表达式,可以更好地适应搜索引擎的需求。文章还提到了一些相关的技术和工具,如Ubuntu、qt编程、tomcat端口、爬虫、php request根目录等。 ... [详细]
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • 搭建Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境的详细步骤
    本文详细介绍了搭建Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境的步骤,包括环境说明、相关软件下载的地址以及所需的插件下载地址。 ... [详细]
  • 本文介绍了使用PHP实现断点续传乱序合并文件的方法和源码。由于网络原因,文件需要分割成多个部分发送,因此无法按顺序接收。文章中提供了merge2.php的源码,通过使用shuffle函数打乱文件读取顺序,实现了乱序合并文件的功能。同时,还介绍了filesize、glob、unlink、fopen等相关函数的使用。阅读本文可以了解如何使用PHP实现断点续传乱序合并文件的具体步骤。 ... [详细]
  • 本文介绍了Hyperledger Fabric外部链码构建与运行的相关知识,包括在Hyperledger Fabric 2.0版本之前链码构建和运行的困难性,外部构建模式的实现原理以及外部构建和运行API的使用方法。通过本文的介绍,读者可以了解到如何利用外部构建和运行的方式来实现链码的构建和运行,并且不再受限于特定的语言和部署环境。 ... [详细]
  • 本文介绍了RPC框架Thrift的安装环境变量配置与第一个实例,讲解了RPC的概念以及如何解决跨语言、c++客户端、web服务端、远程调用等需求。Thrift开发方便上手快,性能和稳定性也不错,适合初学者学习和使用。 ... [详细]
  • Redis底层数据结构之压缩列表的介绍及实现原理
    本文介绍了Redis底层数据结构之压缩列表的概念、实现原理以及使用场景。压缩列表是Redis为了节约内存而开发的一种顺序数据结构,由特殊编码的连续内存块组成。文章详细解释了压缩列表的构成和各个属性的含义,以及如何通过指针来计算表尾节点的地址。压缩列表适用于列表键和哈希键中只包含少量小整数值和短字符串的情况。通过使用压缩列表,可以有效减少内存占用,提升Redis的性能。 ... [详细]
  • Redis API
    安装启动最简启动命令行输入验证动态参数启动配置文件启动常用配置通用命令keysbdsize计算key的总数exists判断是否存在delkeyvalue删除指定的keyvalue成 ... [详细]
  • 本文介绍了如何使用call_user_func_array函数向Redis中添加有序列表或集合。该函数可以接受一个数组作为参数,第一项是要操作的有序列表或集合的键,后续的项目是排序权重和值的交替。通过该函数,可以方便地向Redis中添加多个元素,并指定它们的排序权重。 ... [详细]
  • 本文介绍了在无法联网的情况下,通过下载rpm包离线安装zip和unzip的方法。详细介绍了如何搜索并下载合适的rpm包,以及如何使用rpm命令进行安装。 ... [详细]
  • Redis的默认端口、数据库使用和多端口配置
    本文介绍了Redis的默认端口、数据库使用和多端口配置的方法。通过选择不同的数据库和使用flushdb命令可以实现对不同数据库的访问和清除数据。同时,本文还介绍了在同一台机器上启用多个Redis实例的方法,并讨论了配置认证密码的步骤和注意事项。 ... [详细]
  • 有关phpfgetss()函数的文章推荐10篇
    有关phpfgetss()函数的文章推荐10篇:了解如何使用PHP的各种文件函数。查看诸如fopen、fclose和feof之类的基本文件函数;了解诸如fgets、fgetss和f ... [详细]
  • 导读:在编程的世界里,语言纷繁多样,而大部分真正广泛流行的语言并不是那些学术界的产物,而是在通过自由发挥设计出来的。和那些 ... [详细]
  • php课程Json格式规范需要注意的小细节
    JSON(JavaScriptObjectNotation)是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScriptProgramming ... [详细]
author-avatar
Robin Lu
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有