Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13

Discussione: output per whois

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804

    output per whois

    ciao popolo di html vi vorrei chiedere un aiuto secondo voi quale sono gli output di questo script uno e domai un altro e ext e il risultato cos e?
    vi spiego meglio il form a un testo d imput e un combo ora il testo d input che si chiama domain e il combo ext inviano il risultato a se stesso e qual e la variabile cheda l esito ? mi aguro di essermi spiegato bene
    Codice PHP:
    // include the config file
    require "config.php";
    error_reporting E_WARNING | ~ E_NOTICE ) ; 
    // check whether we are going to use the header and footer template files
    if(!isset($use_global_templates)) {
        
    $use_global_templates $use_global_templates_by_default;    // whether to use the global templates
    }

    // 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();

    // the page titles
    $whois_page_titles = array();

    // the template list
    $whois_templates = array();

    // some substitution strings follow
    $errormsg "";
    $titlebar "MWhois written by Matt Wilson";    // the default title bar
    $rawoutput "";
    $avail = array();
    $unavail = array();
    $whois_server "";

    // the name of the script
    $script_name "mwhois.php";

    function 
    my_in_array($val,$array_)
    {
        for(
    $l=0$l<sizeof($array_); $l++) {
            if(
    $array_[$l] == $val) {
                return 
    1;
            }
        }

        return 
    0;
    }

    // in case the theme can't be found
    function fatal_theme()
    {
        global 
    $theme;

        echo 
    '<HTML><BODY><FONT FACE=VERDANA SIZE=2>MWhois could not load the specified theme `[B]'.$theme.'[/B]\', check the directory exists and try again!</FONT></BODY></HTML>';
        exit();
    }

    // in case the theme can't be found
    function fatal_servers_lst()
    {
        echo 
    '<HTML><BODY><FONT FACE=VERDANA SIZE=2>MWhois could not locate the `servers.lst\' file in the current directory!</FONT></BODY></HTML>';
        exit();
    }

    // loads the page titles into a hash
    function load_page_titles()
    {
        global 
    $whois_page_titles;
        global 
    $theme;
        global 
    $dir_split;
        
        
    // load the titles.cfg file
        
    $titles_cfg_file = @file($theme.$dir_split."titles.cfg");
        if(!
    $titles_cfg_file) { echo "\n"; }

        
    // go through each line of the titles config file and grab what we want
        
    for($l=0$l<sizeof($titles_cfg_file); $l++){
            
    // trim each line and see if its a comment
            
    $titles_cfg_file[$l] = trim($titles_cfg_file[$l]);
            if(
    substr($titles_cfg_file[$l],0,1) == ";") { continue; }
            
            
    // explode the bits, we can't use the limit paramater in case of PHP<4.0.1
            
    $bits explode("|"$titles_cfg_file[$l]);
            
            
    // check to make sure there are at least two bits
            
    if(sizeof($bits) < 2) { continue; }
            
            
    // glue the bits of the line together that are after 2
            
    $flag $bits[0];
            
    $title $bits[1];
            for(
    $t=0$t<sizeof($bits)-2$t++){ $title .= "|".$bits[$t]; }
            
            
    // put the page title in to the hash array
            
    $whois_page_titles[$flag] = $title;
            
            
    // for the sakes of debugging show whats happening
            //echo "\n";
        
    }
    }

    // loads the template filenames into a hash ref
    function load_template_names()
    {
        global 
    $whois_templates;
        global 
    $theme;
        global 
    $dir_split;
        
        
    // load the titles.cfg file
        
    $template_cfg_file = @file($theme.$dir_split."templates.cfg");
        
        if(!
    $template_cfg_file) { fatal_theme(); }
        
        
    // go through each line of the titles config file and grab what we want
        
    for($l=0$l<sizeof($template_cfg_file); $l++){
            
    // trim each line and see if its a comment
            
    $template_cfg_file[$l] = trim($template_cfg_file[$l]);
            if(
    substr($template_cfg_file[$l],0,1) == ";") { continue; }
            
            
    // explode the bits, we can't use the limit paramater in case of PHP<4.0.1
            
    $bits explode("|"$template_cfg_file[$l]);
            
            
    // check to make sure there are at least two bits
            
    if(sizeof($bits) < 2) { continue; }
            
            
    // glue the bits of the line together that are after 2
            
    $flag $bits[0];
            
    $template $bits[1];
            for(
    $t=0$t<sizeof($bits)-2$t++){ $template .= "|".$bits[$t]; }
            
            
    // put the page title in to the hash array
            
    $whois_templates[$flag] = $theme.$dir_split.$template;
            
            
    // for the sakes of debugging show whats happening
            //echo "\n";
        
    }
    }

    // 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;
        global 
    $vars;
        
        
    // load the servers.lst file
        
    $tlds = @file("servers.lst");
        if(!
    $tlds) { fatal_servers_lst(); }

        for(
    $l=0$l<sizeof($tlds); $l++){
            
    // time leading spaces or trailing spaces
            
    $tlds[$l] = chop($tlds[$l]);
            
            
    // filter out the commented lines (begin with #)
            
    if(substr($tlds[$l], 01) == "#" || !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;
        global 
    $vars;

        
    $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."\r\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 
    $vars;
        global 
    $errormsg;
        global 
    $titlebar;
        global 
    $rawoutput;
        global 
    $avail;
        global 
    $unavail;
        global 
    $whois_exts;
        global 
    $whois_servers;
        global 
    $script_name;
        global 
    $theme;
        global 
    $dir_split;
        
        
    $f implode(""file($fil));

        
    $f str_replace("[>WHOIS_SERVER<]",$whois_servers[$vars["ext"]],$f);
        
    $f str_replace("[>TITLE_BAR<]",$titlebar,$f);
        
    $f str_replace("[>DOMAIN<]",$vars["domain"],$f);
        
    $f str_replace("[>FULLDOMAIN<]"$vars["fulldomain"], $f);
        
    $f str_replace("[>ERROR_MSG<]",$errormsg,$f);
        
    $f str_replace("[>RAWOUTPUT<]",$rawoutput,$f);

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

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

        
    $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<]",$vars["ext"],$f);
        
    $f str_replace("[>EXT_LIST<]",implode("
    "
    ,$whois_exts),$f);
        
    $f str_replace("[>EXT_HTML_LIST<]","<select name=\"ext\">\n<option>".implode("\n<option>",$whois_exts)."\n</select>",$f);

        return 
    $f;

    continua

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    qusta e la continuazioe

    Codice PHP:
    // show the error page
    function do_error()
    {
        global 
    $use_global_templates;
        global 
    $vars;
        global 
    $titlebar;
        global 
    $errormsg;
        global 
    $whois_templates;
        global 
    $whois_page_titles;
        
        
    $titlebar $whois_page_titles["error"];

        if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }
        echo 
    make_changes($whois_templates["error"]);
        if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

        exit();
    }

    // checks the domain is legal
    function check_domain()
    {
        global 
    $errormsg;
        global 
    $vars;
        global 
    $whois_exts;

        if(isset(
    $vars["ext"])
            && !isset(
    $vars["do_global"]) 
            && !isset(
    $vars["do_wizard"]) ){
            if(!
    strlen($vars["ext"])){
                
    $errormsg "No top level domain selected";
                return 
    0;
            }
            if(!
    my_in_array($vars["ext"], $whois_exts)){
                
    $errormsg "Top level domain not supported";
                return 
    0;
            }
        }
        if(isset(
    $vars["domain"])){
            if(@
    ereg("^-|-$",$vars["domain"])){
                
    $errormsg "Domain names cannot begin or end in a hyphen or contain double hyphens";
                return 
    0;
            }
            if(!@
    ereg("([a-z]|[A-Z]|[0-9]|-){".strlen($vars["domain"])."}",$vars["domain"]) || !strlen($vars["domain"])){
                
    $errormsg "Domain names must only contain alphanumerical characters and hyphens";
                return 
    0;
            }
        }

        return 
    1;
    }

    // perform_whois function returns 1 if domain is available otherwise returns either the raw info or 0
    function perform_whois($domainname$ext$raw)
    {
        global 
    $vars;
        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 "Cannot connect to [b][i]".$whois_servers[$ext]."[/i][/b]";
            return -
    1;
        }
        
    fputs($ns$domainname.".".$ext."\r\n");
        while(!
    feof($ns)) { $rawoutput .= fgets($ns,128); }

        
    fclose($ns);

        
    $whois_avail_strings[$whois_servers[$ext]] = str_replace("\\n""\n"$whois_avail_strings[$whois_servers[$ext]]);
    //    echo "\n";

        
    $tmp strpos($rawoutput$whois_avail_strings[$whois_servers[$ext]]);
        if(!
    strlen($rawoutput) || is_integer($tmp)) { return 1; }

        return 
    0;
    }

    // this performs the whois lookup and then shows the data returned
    function do_raw($domainname$ext)
    {
        global 
    $vars;
        global 
    $titlebar;
        global 
    $use_global_templates;
        global 
    $whois_info_servers;
        global 
    $whois_servers;
        global 
    $rawoutput;
        global 
    $errormsg;
        global 
    $whois_info_servers_backup;
        global 
    $whois_avail_strings;
        global 
    $whois_server;
        global 
    $whois_page_titles;
        global 
    $whois_templates;
        
        
    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."\r\n");
            while(!
    feof($ns)) { $rawoutput .= fgets($ns128); }

            
    fclose($ns);

        
    //echo "";

        
    $titlebar $whois_page_titles["raw"];

            if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }
            echo 
    make_changes($whois_templates["raw"]);
            if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

        exit();
    }

    function 
    do_getsearch_mini()
    {
        global 
    $whois_templates;
            echo 
    make_changes($whois_templates["searchmini"]);
        exit();
    }

    function 
    do_getsearch()
    {
            global 
    $use_global_templates;
            global 
    $titlebar;
            global 
    $whois_page_titles;
        global 
    $whois_templates;
        
            
    $titlebar $whois_page_titles["search"];

            if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }
            echo 
    make_changes($whois_templates["search"]);
            if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

            exit();    
    }

    function 
    do_avail()
    {
        global 
    $use_global_templates;
        global 
    $titlebar;
        global 
    $whois_templates;
        global 
    $whois_page_titles;
        
            
    $titlebar $whois_page_titles["avail"];

            if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }
            echo 
    make_changes($whois_templates["avail"]);
            if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

        exit();
    }

    function 
    do_taken()
    {
        global 
    $use_global_templates;
        global 
    $titlebar;
        global 
    $whois_page_titles;
        global 
    $whois_templates;

            
    $titlebar $whois_page_titles["taken"];

            if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }
            echo 
    make_changes($whois_templates["taken"]);
            if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

        exit();
    }

    function 
    do_exts()
    {
            global 
    $use_global_templates;
        global 
    $whois_page_titles;
            global 
    $titlebar;
        global 
    $whois_templates;

            
    $titlebar $whois_page_titles["exts"];

            if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }
            echo 
    make_changes($whois_templates["extlist"]);
            if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

            exit();
    }

    function 
    do_glob()
    {
        global 
    $vars;
        global 
    $whois_exts;
        global 
    $avail;
        global 
    $unavail;
            global 
    $use_global_templates;
            global 
    $titlebar;
            global 
    $whois_page_titles;
        global 
    $whois_templates;

        
    $titlebar $whois_page_titles["global"];

        if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }

        if(!isset(
    $vars["domain"])) {
            echo 
    make_changes($whois_templates["global"]);
        } else{
            for(
    $l=0$l<sizeof($whois_exts); $l++){
                if((
    $r perform_whois($vars["domain"], $whois_exts[$l], 0)) != -1){
                    if(!
    $r) { $unavail[] = $vars["domain"].".".$whois_exts[$l]; } else { $avail[] = $vars["domain"].".".$whois_exts[$l]; }
                }
            }

            echo 
    make_changes($whois_templates["globalres"]);
        }

        if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

        exit();
    }

    function 
    do_wiz()
    {
        global 
    $vars;
            global 
    $avail;
            global 
    $unavail;
            global 
    $use_global_templates;
            global 
    $titlebar;
        global 
    $errormsg;
        global 
    $whois_templates;
        global 
    $whois_page_titles;

            
    $titlebar $whois_page_titles["wiz"];

            if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }

        if(!
    $vars["company"] && !$vars["keyword1"] && !$vars["keyword2"]) {
            echo 
    make_changes($whois_templates["wizard"]);
        } else{
            
    // remove whitespace from either side of each variable
            
    $vars["company"] = strtolower(trim($vars["company"]));
            
    $vars["keyword1"] = strtolower(trim($vars["keyword1"]));
            
    $vars["keyword2"] = strtolower(trim($vars["keyword2"]));

            
    $cdomains = array(
                
    $vars["company"],
                
    $vars["company"].$vars["keyword1"],
                
    $vars["company"]."-".$vars["keyword1"],
                
    $vars["keyword1"].$vars["company"],
                
    $vars["keyword1"]."-".$vars["company"],
                            
    $vars["company"].$vars["keyword2"],
                            
    $vars["company"]."-".$vars["keyword2"],
                            
    $vars["keyword2"].$vars["company"],
                            
    $vars["keyword2"]."-".$vars["company"],
                
    $vars["keyword1"],
                
    $vars["keyword2"],
                
    $vars["keyword1"].$vars["keyword2"],
                
    $vars["keyword2"].$vars["keyword1"],
                
    $vars["keyword1"]."-".$vars["keyword2"],
                
    $vars["keyword2"]."-".$vars["keyword1"]
            );

            
    // remove any duplicates :)
            
    $domains = @array_unique($cdomains);

            for(
    $l=0$l<sizeof($domains); $l++){
                
    $vars["domain"] = $domains[$l];
                if(
    check_domain()){
                    if((
    $r perform_whois($vars["domain"], $vars["ext"], 0)) != -&& strlen($vars["domain"]) > 0){
                        if(!
    $r) { $unavail[] = $vars["domain"].".".$vars["ext"]; } else { $avail[] = $vars["domain"].".".$vars["ext"]; }
                    }
                }
            }

                    echo 
    make_changes($whois_templates["wizres"]);
            }

            if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

        exit();
    }

    // this lump of code should sort out register_globals="off" problems :)
    global $vars;

    if(!isset(
    $_SERVER)) { $_SERVER $HTTP_SERVER_VARS; }
    if(!isset(
    $_POST)) { $_POST $HTTP_POST_VARS; }
    if(!isset(
    $_GET)) { $_GET $HTTP_GET_VARS; }
    if(!isset(
    $_COOKIE)) { $_COOKIE $HTTP_COOKIE_VARS; }
    if(!isset(
    $_FILES)) { $_FILES $HTTP_POST_FILES; }
    if(!isset(
    $_ENV)) { $_ENV $HTTP_ENV_VARS; }
    if(!isset(
    $_SESSION)) { $_SESSION $HTTP_SESSION_VARS; }

    while(list(
    $key$var) = each($_GET)) { $vars[$key] = $var; }
    while(list(
    $key$var) = each($_POST)) { $vars[$key] = $var; }

    // try find out the script's path, if the first character is / then assume
    // that the directory splitter is that too (otherwise use \)
    $dir_split "/";
    if(
    $_ENV["DOCUMENT_ROOT"] != "") {
        if(
    substr($_ENV["DOCUMENT_ROOT"], 01) != "/") {
            
    $dir_split "\\";
            echo 
    "\n";
        }
    }

    echo 
    "\n";

    if(!isset(
    $vars["domain"]) && !isset($vars["ext"]) && isset($vars["fulldomain"])) {
        
    $vars["domain"] = ereg_replace("\..*$"""$vars["fulldomain"]);
        
    $vars["ext"] = str_replace($vars["domain"]."."""$vars["fulldomain"]);
    }

    if(!isset(
    $vars["fulldomain"]) && isset($vars["ext"]) && isset($vars["domain"])) {
        
    $vars["fulldomain"] = $vars["domain"].".".$vars["ext"];
    }

    load_server_info();
    load_template_names();
    load_page_titles();

    if(!
    check_domain()) { do_error(); }
    if(
    $vars["do_wizard"]) { do_wiz(); }
    if(
    $vars["do_global"]) { do_glob(); }
    if(
    $vars["list_exts"]) { do_exts(); }
    if(
    $vars["do_mini_search"]) { do_getsearch_mini(); }
    if(!
    $vars["domain"]) { do_getsearch(); }

    if(isset(
    $vars["show_raw"])){
        if(
    perform_whois($vars["domain"], $vars["ext"], 1) != -1) {
            
    $errormsg "MWhois internal error";
        }
        
    do_error();
    }

    $ret perform_whois($vars["domain"], $vars["ext"], 0);
    if(
    $ret == -1) {
        
    do_error();
    }
    if(!
    $ret) {
        
    do_taken();
    } else {
        
    do_avail();
    }
    echo 
    $output

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ragazzi mi date na mano

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ragazzi mi aiutateper favore grazie

  5. #5
    Codice PHP:
    //print "\n";

            
    fputs($ns$domainname.".".$ext."\r\n");
            while(!
    feof($ns)) { $rawoutput .= fgets($ns128); }

            
    fclose($ns);

        
    //echo "";

        
    $titlebar $whois_page_titles["raw"];

            if(
    $use_global_templates) { echo make_changes($whois_templates["header"]); }
            echo 
    make_changes($whois_templates["raw"]);
            if(
    $use_global_templates) { echo make_changes($whois_templates["footer"]); }

        exit();

    dovrebbe essere qui dentro U_U

  6. #6
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    grazie ma qual e la variabile?

  7. #7
    make_changes($whois_templates["raw"]); (prova questa)

  8. #8
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ciao scusa se rispondo solo adesso ma solo adesso mi e tornata la linea comunque provo e ti dico

  9. #9
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    posto questo script che mi sembra piu semplice che da sul dominio il risultato avaiable o no avaiable
    Codice PHP:
    <?php
    /*
        MRWhois v. 4.0 PRO - a Whois lookup script written in PHP.
        Copyright (C) 2001-2004 Marek Rozanski
        [url]http://www.mrscripts.co.uk[/url]
    */
        
    include_once ("mrwhois_config.php");
        include_once (
    FILE_NAME_LANGUAGE);
        
    error_reporting E_WARNING | ~ E_NOTICE ) ; 
    ?>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=<? echo META_CHARSET?>">
        <meta http-equiv="Content-Language" content="<? echo META_LANGUAGE?>">
        <title><? echo PAGE_TITLE_META?></title>
        <link href="<? echo FILE_NAME_STYLE?>" rel="stylesheet" type="text/css">
        <script type=text/javascript>
            var win= null;
            function NewWindow(mypage,myname,w,h,scroll)
            {
                var winl = (screen.width-w)/2;
                  var wint = (screen.height-h)/2;
                var settings  ="height="+h+",";
                settings +="width="+w+",";
                settings +="top="+wint+",";
                settings +="left="+winl+",";
                settings +="scrollbars="+scroll+",";
                settings +="resizable=yes";
                win=window.open(mypage,myname,settings);
                if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
            }
        </script>
    </head>


    <php?
        if (DISPLAY_RESULT_HEADER) include_once (FILE_NAME_HEADER);

        $type = $_POST['type'];
        $ddomain = $_POST['ddomain'];

        if ($type!="") define('TYPE', $type); else define('TYPE', '');
        if ($ddomain!="") { $_ddomain = trim($ddomain); define('DDOMAIN', $_ddomain);    }
        else define('DDOMAIN', '');
        
    //    echo "Debug info:
    ";
    //    echo "TYPE: " . TYPE . "
    ";
    //    echo "DDOMAIN: " . DDOMAIN;

        function extracheck($exdomain,$exserver,$exmatch)
        {
            $exns = fsockopen($exserver,43); fputs($exns,"$exdomain\r\n");
            $exresult = "";
            while(!feof($exns)) $exresult .= fgets($exns,128); fclose($exns);
            if (eregi($exmatch,$exresult))
            {
                $iss = "1";
            } else {
                $iss = "0";
            }
            return $iss;
        }

        function dispav($what,$reglink,$justname,$justtld,$iscname)
        {
            echo '<tr><td nowrap class="available">[b]'.$what.'[/b]';
            if ($iscname=="1") echo ' '.CANONICAL_TEXT;
            echo '</td>
            <td nowrap align="center" class="available">[b]'.AVAILABLE_TEXT.'[/b]</td>
            <td nowrap align="center">';
            // choose the action according to the further processing method:
            if (PROCESSING_TYPE=="2")    // further processing using FORM/POST
            { echo '<input type="Checkbox" name="'.$justtld.'" value="1">'; }
            else if (PROCESSING_TYPE=="3")    // further processing using link/GET
            { echo '[url="'.LINK_EXTERNAL.'?alldomain='.$what.'&domain='.$justname.'&tld='.$justtld.'"]'.LINK_REGISTER_TEXT.'[/url]'; }
            else // just affiliate link
            {
                if ($reglink!="" and REG_LINK)
                { echo '[url="'.$reglink.'"]'.LINK_REGISTER_TEXT.'[/url]'; }
                else if ($reglink=="" and REG_LINK)
                { echo '[url="'.LINK_AFFILIATE.'"]'.LINK_REGISTER_TEXT.'[/url]'; }
                else
                { echo ''; }
            }
            echo '</td></tr>';
        }

        function dispun($what,$where) {
            echo '<tr>
            <td nowrap class="notavailable">[b]'.$what.'[/b]</td>
            <td nowrap align="center" class="notavailable">[b]'.NOT_AVAILABLE_TEXT.'[/b]</td>
            <td nowrap align="center">
            <a href="'.FILE_NAME_DETAILS.'?ddomain='.$what.'&server='.$where.'" onMouseOver="window.status=\''.STATUS_BAR_DETAILS.' '.$what.'\';return true" onMouseOut="window.status=\'\';return true" onClick="NewWindow(this.href,\'details\',\'620\',\'400\',\'yes\');return false;">
            '.LINK_TAKEN_DETAILS.'</a>';
            if (USE_GOTO_LINK)
            {
                echo ' / [url="http://www.'.$what.'"]'.LINK_TAKEN_GOTO.'[/url]';
            }
            echo '</td></tr>';
        }

        function disperror($text) {
            echo '<table align="center" width="600" border="0" cellspacing="0" cellpadding="0">
            <tr><td width="100%" class="windowborder">
            <table width="600" border="0" cellspacing="1" cellpadding="2">
            <tr><td class="windowinside">';
            echo '<center><b class="errors">'.$text.'[/b]</center>';
            echo '</td></tr></table></td></tr></table>';
        }


        if (WAIT_LAYER_ENABLED)
        {
        ?>
            <script language=javascript>
                var ie4 = (document.all) ? true : false;
                var ns4 = (document.layers) ? true : false;
                var ns6 = (document.getElementById && !document.all) ? true : false;
                function hidelayer(lay) {
                    //if (ie4) {document.waitlayer.visible = False; }
                    if (ie4) {document.all[lay].style.visibility = "hidden";}
                    if (ns4) {document.layers[lay].visibility = "hide";}
                    if (ns6) {document.getElementById([lay]).style.display = "none";}
                }
                function showlayer(lay) {
                    if (ie4) {document.all[lay].style.visibility = "visible";}
                    if (ns4) {document.layers[lay].visibility = "show";}
                    if (ns6) {document.getElementById([lay]).style.display = "block";}
                }
                var laywidth  = screen.width/2;
                var layheight = screen.height/2;
                var layl   = (screen.width-laywidth)/2;
                  var layt   = (screen.height-layheight)/2;
                document.write("<div name='waitlayer' id='waitlayer' align='center' style='position:absolute; width:"+laywidth+"px; height:"+layheight+"px; z-index:-1; left:"+layl+"px; top:"+layt+"px; visibility: visible;'><p align=center>[b]<? echo WAIT_TITLE?>[/b]

    [url='<? echo FILE_NAME?>']<? echo WAIT_MESSAGE?>[/url]</p></div>");
            </script>
        <?
        
    }

        
    // Domain name error handling:

        
    if(TYPE!="name" and strlen(DDOMAIN) < 3)
        {
            
    disperror(ERROR_TOO_SHORT);
            if (
    REPEAT_SEARCH_WINDOW) include_once(FILE_NAME);
            if (
    WAIT_LAYER_ENABLED) echo '<script language="javascript">hidelayer("waitlayer");</script>';
            if (
    DISPLAY_RESULT_FOOTER) include_once(FILE_NAME_FOOTER);
            exit;
        }
        if(
    TYPE!="name" and strlen(DDOMAIN) > 63)
        {
            
    disperror(ERROR_TOO_LONG);
            if (
    REPEAT_SEARCH_WINDOW) include_once(FILE_NAME);
            if (
    WAIT_LAYER_ENABLED) echo '<script language="javascript">hidelayer("waitlayer");</script>';
            if (
    DISPLAY_RESULT_FOOTER) include_once(FILE_NAME_FOOTER);
            exit;
        }
        if(
    TYPE!="name" and ereg("^-|-$",DDOMAIN))
        {
            
    disperror(ERROR_HYPHEN);
            if (
    REPEAT_SEARCH_WINDOW) include_once(FILE_NAME);
            if (
    WAIT_LAYER_ENABLED) echo '<script language="javascript">hidelayer("waitlayer");</script>';
            if (
    DISPLAY_RESULT_FOOTER) include_once(FILE_NAME_FOOTER);
            exit;
        }
        if(
    TYPE!="name" and !ereg("([a-z]|[A-Z]|[0-9]|-){".strlen(DDOMAIN)."}",DDOMAIN))
        {
            
    disperror(ERROR_CHARACTERS);
            if (
    REPEAT_SEARCH_WINDOW) include_once(FILE_NAME);
            if (
    WAIT_LAYER_ENABLED) echo '<script language="javascript">hidelayer("waitlayer");</script>';
            if (
    DISPLAY_RESULT_FOOTER) include_once(FILE_NAME_FOOTER);
            exit;
        }
        if(
    TYPE=="name")
        {
            if (!
    eregi("\.",DDOMAIN))
            {
                
    disperror(ERROR_NAME_DOT);
                if (
    REPEAT_SEARCH_WINDOW) include_once(FILE_NAME);
                if (
    WAIT_LAYER_ENABLED) echo '<script language="javascript">hidelayer("waitlayer");</script>';
                if (
    DISPLAY_RESULT_FOOTER) include_once(FILE_NAME_FOOTER);
                exit;
            }
            else
            {
                list(
    $leftpart$rightpart) = explode(".",DDOMAIN);
                if (
    strlen($rightpart)<3)
                {
                    
    disperror(ERROR_NAME_LEN);
                    if (
    REPEAT_SEARCH_WINDOW) include_once(FILE_NAME);
                    if (
    WAIT_LAYER_ENABLED) echo '<script language="javascript">hidelayer("waitlayer");</script>';
                    if (
    DISPLAY_RESULT_FOOTER) include_once(FILE_NAME_FOOTER);
                    exit;
                }
            }
        }

        if (
    PROCESSING_TYPE=="2")
        {
            echo 
    '<form action="'.LINK_EXTERNAL.'" method="POST">';
            echo 
    '<input type="hidden" name="domain" value="'.DDOMAIN.'">';
        }

        echo 
    '<table align="center" width="600" border="0" cellspacing="0" cellpadding="0">
            <tr><td width="100%" class="windowborder"><table width="600" border="0" cellspacing="1" cellpadding="2">
            <tr><td class="windowinside"><table width="100%" align="center" cellspacing="0" cellpadding="1">
            <tr>
                <td nowrap align="center" class="separator">[b]Domain[/b]</td>
                <td nowrap align="center" class="separator">[b]Status[/b]</td>
                <td nowrap align="center" class="separator">[b]Action[/b]</td>
            </tr>'
    ;

        
    $avno=0
        if (
    USE_ENGINE=="1") {
            if (
    TYPE == 'all') {
                
    $fp fopen(FILE_NAME_SERVERS,"r");
                while (!
    feof ($fp)) {
                    
    $data fgets($fp4096);
                    if (!
    eregi('##',$data)) {
                        list(
    $tld$include$server$nomatch$link) = explode("|",$data);
                        if (
    $include=="1" and $tld!="name") {
                            
    $ddomain eregi_replace(" ","",DDOMAIN);
                            
    $domname $ddomain.".".$tld;
                            
    $domname2 escapeshellcmd ($domname).".";
                            if (
    checkdnsrr($domname2.".","NS")==false// check if there is a nameserver assigned to a domain
                            
    {
                                if(
    USE_EXTRACHECK)
                                {
                                    
    $extrano extracheck($domname,$server,$nomatch);
                                    if (
    $extrano=="1") {
                                        
    dispav($domname,$link,$ddomain,$tld,0);
                                        
    $avno=1;
                                    } else {
                                        
    dispun($domname,$server);
                                    }
                                } else {
                                    
    dispav($domname,$link,$ddomain,$tld,0);
                                    
    $avno=1;
                                }
                            } else {
                                if(
    USE_CNAMECHECK)
                                {
                                    
    // check if the domain is a canonical name
                                    
    if (checkdnsrr($domname2.".","CNAME")==true)
                                    {
                                        
    dispav($domname,$link,$ddomain,$tld,1);
                                        
    $avno=1;
                                    } else {
                                        
    dispun($domname,$server);
                                    }
                                } else {
                                    
    dispun($domname,$server);
                                }
                            }
                        }
                        else if (
    $include=="1" and $tld=="name") {
                            echo 
    "<tr><td colspan=3 align=center><font size=-2>".NAME_WARNING."</font></td></tr>";
                        }
                    }
                }
                
    fclose($fp);
            } else {
                
    $fp fopen(FILE_NAME_SERVERS,"r");
                while (!
    feof ($fp)) {
                    
    $data fgets($fp4096);
                    if (!
    eregi('##',$data)) {
                        list(
    $tld$include$server$nomatch$link) = explode("|",$data);
                        if (
    $tld==TYPE) {
                            
    $ddomain eregi_replace(" ","",DDOMAIN);
                            
    $domname $ddomain.".".$tld;
                            
    $domname2 escapeshellcmd ($domname).".";
                            if (
    checkdnsrr($domname2.".","NS")==false)
                            {
                                if (
    USE_EXTRACHECK)
                                {
                                    
    $extrano extracheck($domname,$server,$nomatch);
                                    if (
    $extrano=="1") {
                                        
    dispav($domname,$link,$ddomain,$tld,0);
                                        
    $avno=1;
                                    } else {
                                        
    dispun($domname,$server);
                                    }
                                } else {
                                    
    dispav($domname,$link,$ddomain,$tld,0);
                                    
    $avno=1;
                                }
                            } else {
                                if (
    USE_CNAMECHECK)
                                {
                                
    // check if the domain is a canonical name
                                    
    if (checkdnsrr($domname2.".","CNAME")==true)
                                    {
                                        
    dispav($domname,$link,$ddomain,$tld,1);
                                        
    $avno=1;
                                    } else {
                                        
    dispun($domname,$server);
                                    }
                                } else {
                                    
    dispun($domname,$server);
                                }
                            }
                        }
                    }
                }
                
    fclose($fp);
            }
    segue il resto

  10. #10
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    Codice PHP:
    // using nslookup command
        
        
    } else if (USE_ENGINE=="2") {

            if (
    TYPE == 'all') {
                
    $fp fopen(FILE_NAME_SERVERS,"r");
                while (!
    feof ($fp)) {
                    
    $data fgets($fp4096);
                    if (!
    eregi('##',$data)) {
                        list(
    $tld$include$server$nomatch$link) = explode("|",$data);
                        if (
    $include=="1" and $tld!="name") {
                            
    $ddomain eregi_replace(" ","",DDOMAIN);
                            
    $domname $ddomain.".".$tld$domname2 escapeshellcmd ($domname);
                            
    $result ""$outputstring "";
                            
    $command2 "nslookup -type=ns $domname2";
                            
    exec ($command2,$result);
                            
    $outputno count($result);
                            for (
    $ino=0;$ino<=$outputno;$ino++) { $outputstring .= $result[$ino]; }
                            if (!
    eregi("nameserver",$outputstring)) { 
                                if (
    USE_EXTRACHECK)
                                {
                                    
    $extrano extracheck($domname,$server,$nomatch);
                                    if (
    $extrano==1) {
                                        
    dispav($domname,$link,$ddomain,$tld,0);
                                        
    $avno=1;
                                    } else {
                                        
    dispun($domname,$server);
                                    }
                                } else {
                                    
    dispav($domname,$link,$ddomain,$tld,0);
                                    
    $avno=1;
                                }
                            } else { 
                                if (
    USE_CNAMECHECK)
                                {
                                    
    // check if the domain is a canonical name
                                    
    $command3 "nslookup -type=cname $domname2";
                                    
    exec ($command3,$result3);
                                    
    $outputno3 count($result3);
                                    for (
    $ino3=0;$ino3<=$outputno3;$ino3++) { $outputstring3 .= $result3[$ino3]; }
                                    if (!
    eregi("canonical",$outputstring3)) { 
                                        
    dispun($domname,$server);
                                    } else {
                                        
    dispav($domname,$link,$ddomain,$tld,1);
                                        
    $avno=1;
                                    }
                                } else {
                                    
    dispun($domname,$server);
                                }
                            }
                        } else if (
    $include=="1" and $tld=="name") {
                            echo 
    "<tr><td colspan=3 align=center><font size=-2>".NAME_WARNING."</font></td></tr>";
                        }
                    }
                }
                
    fclose($fp);
            } else {
                
    $fp fopen(FILE_NAME_SERVERS,"r");
                while (!
    feof ($fp)) {
                    
    $data fgets($fp4096);
                    if (!
    eregi('##',$data)) {
                        list(
    $tld$include$server$nomatch$link) = explode("|",$data);
                        if (
    $tld==TYPE) {
                            
    $ddomain eregi_replace(" ","",DDOMAIN);
                            
    $domname $ddomain.".".$tld$domname2 escapeshellcmd ($domname);
                            
    $result ""$outputstring "";
                            
    $command2 "nslookup -type=ns $domname2";
                            
    exec ($command2,$result);
                            
    $outputno count($result);
                            for (
    $ino=0;$ino<=$outputno;$ino++) { $outputstring .= $result[$ino]; }
                            if (!
    eregi("nameserver",$outputstring)) {
                                if (
    USE_EXTRACHECK)
                                {
                                    
    $extrano extracheck($domname,$server,$nomatch);
                                    if (
    $extrano==1) {
                                        
    dispav($domname,$link,$ddomain,$tld,0);
                                        
    $avno=1;
                                    } else {
                                        
    dispun($domname,$server);
                                    }
                                } else {
                                    
    dispav($domname,$link,$ddomain,$tld,0);
                                    
    $avno=1;
                                }
                            } else { 
                                if (
    USE_CNAMECHECK)
                                {
                                    
    // check if the domain is a canonical name
                                    
    $command3 "nslookup -type=cname $domname2";
                                    
    exec ($command3,$result3);
                                    
    $outputno3 count($result3);
                                    for (
    $ino3=0;$ino3<=$outputno3;$ino3++) { $outputstring3 .= $result3[$ino3]; }
                                    if (!
    eregi("canonical",$outputstring3)) { 
                                        
    dispun($domname,$server);
                                    } else {
                                        
    dispav($domname,$link,$ddomain,$tld,1);
                                        
    $avno=1;
                                    }
                                } else {
                                    
    dispun($domname,$server);
                                }
                            }
                        }
                    }
                }
                
    fclose($fp);
            }

        } else {


        
    // using engine "3" - fsockopen() function - slowest but most reliable

            
    if (TYPE == 'all') {
                
    $fp fopen(FILE_NAME_SERVERS,"r");
                while (!
    feof ($fp)) {
                    
    $data fgets($fp4096);
                    if (!
    eregi('##',$data)) {
                        list(
    $tld$include$server$nomatch$link) = explode("|",$data);
                        if (
    $include=="1" and $tld!="name") {
                            
    $ddomain eregi_replace(" ","",DDOMAIN);
                            
    $domname $ddomain.".".$tld;
                            
    $result "";
                            
    $ns fsockopen($server,43); fputs($ns,"$domname\r\n");
                            while(!
    feof($ns)) $result .= fgets($ns,128); fclose($ns);
                            if (
    eregi($nomatch,$result)) { $avno=1dispav($domname,$link,$ddomain,$tld,0); } else dispun($domname,$server);
                        } else if (
    $include=="1" and $tld=="name") {
                            echo 
    "<tr><td colspan=3 align=center><font size=-2>".NAME_WARNING."</font></td></tr>";
                        }
                    }
                }
                
    fclose($fp);
            }
            else
            {
                
    $fp fopen(FILE_NAME_SERVERS,"r");
                while (!
    feof ($fp)) {
                    
    $data fgets($fp4096);
                    if (!
    eregi('##',$data)) {
                        list(
    $tld$include$server$nomatch$link) = explode("|",$data);
                        if (
    $tld==TYPE) {
                            
    $ddomain eregi_replace(" ","",DDOMAIN);
                            
    $domname $ddomain.".".$tld;
                            
    $result "";
                            
    $ns fsockopen($server,43); fputs($ns,"$domname\r\n");
                            while(!
    feof($ns)) $result .= fgets($ns,128); fclose($ns);
                            if (
    eregi($nomatch,$result)) 
                            { 
    $avno=1dispav($domname,$link,$ddomain,$tld,0); } else { dispun($domname,$server); }
                        }
                    }
                }
                
    fclose($fp);
            }
        }
        if (
    PROCESSING_TYPE=="2" and $avno==1)
        {
            echo 
    '<tr><td colspan="3" align="right"><input type=submit value="'.BUTTON_NEXT.'"></td></tr>';
        }

        echo 
    '</table>';
        echo 
    '</td></tr></table></td></tr></table>';

        if (
    PROCESSING_TYPE=="2")
        {
            echo 
    '</form>';
        }


        if (
    WAIT_LAYER_ENABLED) { echo '<script language="javascript">hidelayer("waitlayer");</script>'; }

        
    // if logging enabled write info to the file
        
    if(WANTLOG)    {
            
    $remote_addr $REMOTE_ADDR;
            
    $today date("d-m-y H:i"time());
            if (
    file_exists(FILE_NAME_LOG) and is_writeable(FILE_NAME_LOG))    {
                
    $fp fopen(FILE_NAME_LOG,"a+");
                
    $infolog "Date: $today | IP: $remote_addr | ".DDOMAIN."\n";
                
    fputs($fp$infolog);
                
    fclose($fp);
            }
        }
        if (
    REPEAT_SEARCH_WINDOW)
        {
            include_once(
    FILE_NAME);
        }
        if (
    DISPLAY_RESULT_FOOTER) include_once(FILE_NAME_FOOTER);
    ?> 

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.