Salve a tutti,
ho un problema d porvi.

Stavo provando uno script whois per testare se varie estensioni di domini sono libere o meno.
Ecco il codice:

Codice PHP:
<?php 
$whois_server 
$_GET['whois_server'];

include(
"server_list.php");

include(
"whois_class.php");

$my_whois = new Whois_domain;

$my_whois->possible_tlds array_keys($servers); // this is the array from the included server list


if (isset($_POST['submit'])) {

    
$my_whois->tld $_POST['tld'];

    
$my_whois->domain $_POST['domain'];

    
$my_whois->free_string $servers[$_POST['tld']]['free'];

    
$my_whois->whois_server $servers[$_POST['tld']]['address'];

    
$my_whois->whois_param $servers[$_POST['tld']]['param'];

    if (
$my_whois->process()) {


    }

}

?>
<?php 
echo ($my_whois->msg != "") ? $my_whois->msg ""?>

con la classe associata (whois_class.php):
Codice PHP:
<?php

class Whois_domain {
    
    var 
$possible_tlds;
    var 
$whois_server;
    var 
$free_string;
    var 
$whois_param;
    var 
$domain;
    var 
$tld;
    var 
$compl_domain;
    var 
$full_info;
    var 
$msg;
    var 
$info;
    var 
$os_system "linux"// switch between "linux" and "win"
     
    
function Whois_domain() {
        
$this->info "";
        
$this->msg "";
    }
    function 
process() {
        if (
$this->create_domain()) {
            if (
$this->full_info == "yes") {
                
$this->get_domain_info();
            } else {
                if (
$this->check_only() == 1) {
                    
$this->msg "<center><font face=\"Verdana\" size=\"2\" color=\"#000000\">Il dominio: [b]".$this->compl_domain."[/b] è libero per procedere alla registrazione: <a href=\"ordini.php?dominio=".$this->compl_domain."\">[b]clicca qui[/b]</a>";
                    return 
true;
                } elseif (
$this->check_only() == 0) {
                    
$this->msg "<center>SPIACENTE - Il dominio: [b]".$this->compl_domain."[/b] è già stato registrato

[b]cerca un altro dominio[/b]</font></center>"
;
                    return 
false;
                } else {
                    
$this->msg "Riprova";
                }
            }
        } else {
            
$this->msg "<center>Solo lettere, numeri e il carattere - sono utilizzabili!</center>";
        }
ed il file server_list.php:

Codice PHP:
<?php 

$servers
['it']['address'] = "whois.nic.it";
$servers['it']['free'] = "No entries found";
$servers['it']['param'] = "";

$servers['com']['address'] = "whois.crsnic.net";
$servers['com']['free'] = "No match for";
$servers['com']['param'] = "";

$servers['net']['address'] = "whois.crsnic.net";
$servers['net']['free'] = "No match for";
$servers['net']['param'] = "";

$servers['org']['address'] = "whois.pir.org";
$servers['org']['free'] = "NOT FOUND";
$servers['org']['param'] = "";

$servers['eu']['address'] = "Whois.eu";
$servers['eu']['free'] = "FREE";
$servers['eu']['param'] = "";

$servers['biz']['address'] = "whois.nic.biz";
$servers['biz']['free'] = "Not found";
$servers['biz']['param'] = "";

$servers['info']['address'] = "whois.afilias.net";
$servers['info']['free'] = "NOT FOUND";
$servers['info']['param'] = "";

$servers['gs']['address'] = "whois.adamsnames.tc";
$servers['gs']['free'] = "not registered";
$servers['gs']['param'] = "";

?>
Funziona tutto correttamente tranne che la ricerca dei domini .IT che indica sempre occupati (anche se non lo sono).
Ho provato a contrallare il server whois, ma mi sembra corretto: whois.nic.it

Attendo gentilmente una vostra risposta.
Grazie e buona giornata a tutti