文件一:index.php

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\".implode(\"\\n\",$whois_exts).\"\\n\",$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_exts)){

$errormsg = \"不支持此域名后缀\";

return 0;

}

}

if(isset($domain)){

if(strlen($domain) < 2 || strlen($domain) > 57){

$errormsg = \"域名太长或太短";

return 0;

}

if(strlen($domain) == 2 && !ereg(\"([0-9]){2}\",$domain)){

$errormsg = \"在2个字节的域名中不能包含有字母\";

return 0;

}

if(ereg(\"^-|-$\",$domain)){

$errormsg = \"域名前和域名后不能使用-,也不可以连续使用-\";

return 0;

}

if(!ereg(\"([a-z]|[A-Z]|[0-9]|-){\".strlen($domain).\"}\",$domain)){

$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)) == false){

$errormsg = \"无法连接到域名查询服务器 \".$whois_servers[$ext].\"\";

return -1;

}

fputs($ns,\"$domainname.$ext\\n\");

while(!feof($ns))

$rawoutput .= fgets($ns,128);

fclose($ns);

echo \"\\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 \"\\n\";

fputs($ns,\"$domainname.$ext\\n\");

while(!feof($ns))

$rawoutput = $rawoutput.fgets($ns,128);

fclose($ns);

echo \"\";

// $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; $lif(($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; $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) != -1)

$errormsg = \"MWhois域名查询内部错误\";

do_error();

}

$ret = perform_whois($domain,$ext,0);

if($ret == -1)

do_error();

if(!$ret)

do_taken();

else

do_avail();

?>

相关文章

相关视频

纯php程序无数据,无数据库的详细域名查询程序PHP版(1)_php基础相关推荐

  1. mybatis 执行插入操作,insert 返回1,数据库中无数据。数据库中数据的创建时间和插入执行时间不一致。

    大家好,我是烤鸭: 今天记录一下线上的问题,由于不是我们组的代码,所以没参与全程,只是最后有幸听各位大佬探讨解决方案.mybatis 执行插入操作,insert返回1,日志记录和接口返回都正常,但是数 ...

  2. 微信小程序菜品做法展示数据库设计_微信小程序结合后台数据管理实现商品数据的动态展示、维护...

    微信小程序给我们提供了一个很好的开发平台,可以用于展现各种数据和实现丰富的功能,本篇随笔介绍微信小程序结合后台数据管理实现商品数据的动态展示.维护,介绍如何实现商品数据在后台管理系统中的维护管理,并通 ...

  3. 基于PHP+小程序(MINA框架)+Mysql数据库的评选投票小程序系统设计与实现

    项目背景和意义 目的:本课题主要目标是设计并能够实现一个基于微信小程序评选投票系统,前台用户使用小程序,后台管理使用基PHP+MySql的B/S架构:通过后台添加资讯.管理上传投票信息.用户管理等:用 ...

  4. 基于Java后台(Springboot框架)+前端小程序(MINA框架)+Mysql数据库的菜谱美食小程序系统设计与实现

    项目背景和意义 目的:本课题主要目标是设计并能够实现一个基于微信小程序美食菜谱点评系统,前台用户使用小程序,后台管理使用Java+Mysql开发,后台使用了springboot框架:通过后台添加资讯和 ...

  5. 基于PHP+小程序(MINA框架)+Mysql数据库的疫苗预约小程序系统设计与实现

    项目背景和意义 目的:本课题主要目标是设计并能够实现一个基于微信小程序疫苗预约系统,前台用户使用小程序,后台管理使用基PHP+MySql的B/S架构:通过后台添加疫苗内容.价格.开放预约的日期和时间段 ...

  6. Python_爬虫数据存入数据库(超详细过程

    目录 一.新建项目 二.程序的编写 三.数据的爬取 一.新建项目 1.在cmd窗口输入scrapy startproject [项目名称] 创建爬虫项目 接着创建爬虫文件,scrapy genspid ...

  7. oracle更新所有数据,ORACLE数据库升级详细步骤

    ORACLE数据库升级详细步骤 时间:2010-10-16 00:59 来源: 作者: 点击: 260次 一.对ORACLE数据库进行备份 二.确认ORACLE数据库的Home目录安装路径 三.关闭数 ...

  8. 微信小程序添加数据到数据库中

    在一个事件函数中 //stu是一个数据库的名称 const db = wx.cloud.database() const stu =  db.collection('student') //添加一个d ...

  9. 基于PHP+小程序(MINA框架)+Mysql数据库的干洗店洗衣小程序系统设计与实现

    项目背景和意义 目的:本课题主要目标是设计并能够实现一个基于微信校园洗衣小程序系统,前台用户使用小程序,小程序使用微信开发者工具开发:后台管理使用基PP+MySql的B/S架构,开发工具使用phpst ...

  10. 基于PHP+小程序(MINA框架)+Mysql数据库的校园跑腿小程序系统设计与实现

    项目背景和意义 目的:本课题主要目标是设计并能够实现一个基于微信校园跑腿小程序系统,前台用户使用小程序发布跑腿任何和接跑腿任务,后台管理使用基于PHP+MySql的B/S架构:通过后台管理跑腿的用户. ...

最新文章

  1. 2021年大数据Spark(四十五):Structured Streaming Sources 输入源
  2. “约见”面试官系列之常见面试题之第六十六篇之事件委托的原理和实现(建议收藏)
  3. micropython oled中文_micropython中怎么将gb2312编码的字节流变成中文
  4. nxos启动的初始化和https访问nx-api
  5. linux sudo输入密码无法获得锁,Linux系统提示无法获得锁/var/lib/dpkg/lock怎么办?
  6. 程序员的修炼之道——从小工到专家
  7. CSS overflow属性与display属性
  8. [ROS-Beginner]1.安装与配置ROS环境
  9. Xcode5 取消项目ARC,或者单个类ARC切换
  10. 为何国内“程序员”是秃头代名词?来看看国外程序员的一天
  11. ireport 循环_iReport制作报表1:iReport Designer的使用
  12. Python math 模块与 cmath 模块
  13. 朋也bbs开源学习(一)
  14. java实现生成指定位数随机字符串要求包含数字大小写字母三种类型字符
  15. 1527. 患某种疾病的患者
  16. 互联网公司logo logo制作
  17. c++实现五子棋单机版(自娱自乐)
  18. 【tio-core】1、tio-study是学习t-io的第一步
  19. 海马体照相馆携手神策数据:99.7% 的摄影满意度,离不开专业与数据驱动
  20. CAD-VB多段线、波浪线、射线、构造线

热门文章

  1. 图解ZooKeeper的典型应用场景(转载)
  2. 10- monkey日志分析
  3. Linux 常用系统工具与初始化配置
  4. 如何更好的理解用户反馈? | 上
  5. Windows 10一周年更新版本号将锁定为Build 14393
  6. RDMA的原理、传输与Verbs
  7. 静态页面对seo优化之详解
  8. linux下查看表类型注释命令@tcc
  9. NetBeans 时事通讯(刊号 # 120 - Oct 14, 2010)
  10. 新塘linux启动过程,NUC972调试笔记之NAND分区调整新增