찾다
백엔드 개발PHP 튜토리얼无数据库的详细域名查询程序PHP版(1)_PHP教程

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

Jul 21, 2016 pm 04:06 PM
echoindex.phpmwphp하나도메인 이름데이터 베이스문서질문버전~의프로그램상세한

文件一: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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315524.htmlTechArticle文件一:index.php ?php echo !-- Powered by MWhois written by Matt Wilson matt@mattsscripts.co.uk --\\n\; /* #####################################################################...
성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
PHP는 사용자 세션을 어떻게 식별합니까?PHP는 사용자 세션을 어떻게 식별합니까?May 01, 2025 am 12:23 AM

phpidifiesauser의 sssessionusessessioncookiesandssessionids.1) whensession_start () iscalled, phpgeneratesauniquessessionStoredInacookienamedPhpsSessIdonSeuser 'sbrowser.2) thisidallowsphptoretrievessessionDataTromServer.

PHP 세션을 확보하기위한 모범 사례는 무엇입니까?PHP 세션을 확보하기위한 모범 사례는 무엇입니까?May 01, 2025 am 12:22 AM

PHP 세션의 보안은 다음 측정을 통해 달성 할 수 있습니다. 1. Session_REGENEREAT_ID ()를 사용하여 사용자가 로그인하거나 중요한 작업 일 때 세션 ID를 재생합니다. 2. HTTPS 프로토콜을 통해 전송 세션 ID를 암호화합니다. 3. 세션 _save_path ()를 사용하여 세션 데이터를 저장하고 권한을 올바르게 설정할 보안 디렉토리를 지정하십시오.

PHP 세션 파일은 기본적으로 어디에 저장됩니까?PHP 세션 파일은 기본적으로 어디에 저장됩니까?May 01, 2025 am 12:15 AM

phpsessionfilesarestoredInTheRectorySpecifiedBysession.save_path, 일반적으로/tmponunix-likesystemsorc : \ windows \ temponwindows.tocustomizethis : 1) austession_save_path () toSetacustomDirectory, verlyTeCustory-swritation;

PHP 세션에서 데이터를 어떻게 검색합니까?PHP 세션에서 데이터를 어떻게 검색합니까?May 01, 2025 am 12:11 AM

toretrievedatafromAphPsession, startSessionstart_start () andaccessvariblesinthe $ _sessionArray.forexample : 1) startthessession : session_start (). 2) retrievedata : $ _ session [ 'username']; echo "Welcome,". $ username;

세션을 사용하여 쇼핑 카트를 구현할 수있는 방법은 무엇입니까?세션을 사용하여 쇼핑 카트를 구현할 수있는 방법은 무엇입니까?May 01, 2025 am 12:10 AM

세션을 사용하여 효율적인 쇼핑 카트 시스템을 구축하는 단계에는 다음이 포함됩니다. 1) 세션의 정의와 기능을 이해합니다. 세션은 요청에 따라 사용자 상태를 유지하는 데 사용되는 서버 측 스토리지 메커니즘입니다. 2) 쇼핑 카트에 제품 추가와 같은 기본 세션 관리를 구현합니다. 3) 제품 수량 관리 및 삭제 지원 고급 사용으로 확장; 4) 세션 데이터를 지속하고 보안 세션 식별자를 사용하여 성능 및 보안을 최적화합니다.

PHP에서 인터페이스를 어떻게 생성하고 사용합니까?PHP에서 인터페이스를 어떻게 생성하고 사용합니까?Apr 30, 2025 pm 03:40 PM

이 기사는 PHP의 인터페이스를 생성, 구현 및 사용하는 방법을 설명하여 코드 구성 및 유지 관리에 대한 이점에 중점을 둡니다.

crypt ()와 password_hash ()의 차이점은 무엇입니까?crypt ()와 password_hash ()의 차이점은 무엇입니까?Apr 30, 2025 pm 03:39 PM

이 기사에서는 PHP의 암호 해싱에 대한 Crypt ()와 Password_hash ()의 차이점에 대해 논의하여 최신 웹 애플리케이션에 대한 구현, 보안 및 적합성에 중점을 둡니다.

PHP의 크로스 사이트 스크립팅 (XSS)을 어떻게 방지 할 수 있습니까?PHP의 크로스 사이트 스크립팅 (XSS)을 어떻게 방지 할 수 있습니까?Apr 30, 2025 pm 03:38 PM

기사는 입력 유효성 검사, 출력 인코딩 및 OWASP ESAPI 및 HTML 청정기와 같은 도구를 통해 PHP의 크로스 사이트 스크립팅 (XSS) 방지에 대해 논의합니다.

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

PhpStorm 맥 버전

PhpStorm 맥 버전

최신(2018.2.1) 전문 PHP 통합 개발 도구

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SecList

SecList

SecLists는 최고의 보안 테스터의 동반자입니다. 보안 평가 시 자주 사용되는 다양한 유형의 목록을 한 곳에 모아 놓은 것입니다. SecLists는 보안 테스터에게 필요할 수 있는 모든 목록을 편리하게 제공하여 보안 테스트를 더욱 효율적이고 생산적으로 만드는 데 도움이 됩니다. 목록 유형에는 사용자 이름, 비밀번호, URL, 퍼징 페이로드, 민감한 데이터 패턴, 웹 셸 등이 포함됩니다. 테스터는 이 저장소를 새로운 테스트 시스템으로 간단히 가져올 수 있으며 필요한 모든 유형의 목록에 액세스할 수 있습니다.