0

0

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

php中文网

php中文网

发布时间:2016-06-01 14:29:20

|

1165人浏览过

|

来源于php中文网

原创

文件一: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   [>RAWOUTPUT   [>WHOIS_SERVER   [>AVAIL_LIST   [>UNAVAIL_LIST   [>ERROR_MSG   [>EXT   [>EXT_HTML_LIST   [>EXT_LIST
 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   $f = str_replace(\"[>TITLE_BAR   $f = str_replace(\"[>DOMAIN   $f = str_replace(\"[>ERROR_MSG   $f = str_replace(\"[>RAWOUTPUT
  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\",$whois_exts),$f);
  $f = str_replace(\"[>EXT_HTML_LIST
name=ext>\\n

相关文章

PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
Golang处理数据库错误教程合集
Golang处理数据库错误教程合集

本专题整合了Golang数据库错误处理方法、技巧、管理策略相关内容,阅读专题下面的文章了解更多详细内容。

39

2026.02.06

java多线程方法汇总
java多线程方法汇总

本专题整合了java多线程面试题、实现函数、执行并发相关内容,阅读专题下面的文章了解更多详细内容。

17

2026.02.06

1688阿里巴巴货源平台入口与批发采购指南
1688阿里巴巴货源平台入口与批发采购指南

本专题整理了1688阿里巴巴批发进货平台的最新入口地址与在线采购指南,帮助用户快速找到官方网站入口,了解如何进行批发采购、货源选择以及厂家直销等功能,提升采购效率与平台使用体验。

289

2026.02.06

快手网页版入口与电脑端使用指南 快手官方短视频观看入口
快手网页版入口与电脑端使用指南 快手官方短视频观看入口

本专题汇总了快手网页版的最新入口地址和电脑版使用方法,详细提供快手官网直接访问链接、网页端操作教程,以及如何无需下载安装直接观看短视频的方式,帮助用户轻松浏览和观看快手短视频内容。

150

2026.02.06

C# 多线程与异步编程
C# 多线程与异步编程

本专题深入讲解 C# 中多线程与异步编程的核心概念与实战技巧,包括线程池管理、Task 类的使用、async/await 异步编程模式、并发控制与线程同步、死锁与竞态条件的解决方案。通过实际项目,帮助开发者掌握 如何在 C# 中构建高并发、低延迟的异步系统,提升应用性能和响应速度。

11

2026.02.06

Python 微服务架构与 FastAPI 框架
Python 微服务架构与 FastAPI 框架

本专题系统讲解 Python 微服务架构设计与 FastAPI 框架应用,涵盖 FastAPI 的快速开发、路由与依赖注入、数据模型验证、API 文档自动生成、OAuth2 与 JWT 身份验证、异步支持、部署与扩展等。通过实际案例,帮助学习者掌握 使用 FastAPI 构建高效、可扩展的微服务应用,提高服务响应速度与系统可维护性。

7

2026.02.06

JavaScript 异步编程与事件驱动架构
JavaScript 异步编程与事件驱动架构

本专题深入讲解 JavaScript 异步编程与事件驱动架构,涵盖 Promise、async/await、事件循环机制、回调函数、任务队列与微任务队列、以及如何设计高效的异步应用架构。通过多个实际示例,帮助开发者掌握 如何处理复杂异步操作,并利用事件驱动设计模式构建高效、响应式应用。

11

2026.02.06

java连接字符串方法汇总
java连接字符串方法汇总

本专题整合了java连接字符串教程合集,阅读专题下面的文章了解更多详细操作。

47

2026.02.05

java中fail含义
java中fail含义

本专题整合了java中fail的含义、作用相关内容,阅读专题下面的文章了解更多详细内容。

29

2026.02.05

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
进程与SOCKET
进程与SOCKET

共6课时 | 0.4万人学习

Swoft2.x速学之http api篇课程
Swoft2.x速学之http api篇课程

共16课时 | 1.0万人学习

第三期培训_PHP开发
第三期培训_PHP开发

共116课时 | 26.4万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号