Visualizzazione risultati 1 fino 4 di 4

Discussione: gethostbyaddr funziona?

  1. #1
    fabiotom non è connesso Neofita
    Data registrazione
    09-12-2003
    Messaggi
    2

    Predefinito gethostbyaddr funziona?

    Ciao,

    gethostbyaddr funziona? Io sto usando il seguente script:

    $IP= $_SERVER['REMOTE_ADDR'];
    $hostname = gethostbyaddr($_SERVER["REMOTE_ADDR"]);
    $AGENT= $_SERVER['HTTP_USER_AGENT'];
    $message .= "\nRemote address: $IP";
    $message .= "\nRemote host: $hostname";
    $message .= "\nRemote user agent: $AGENT";

    ma ho ottenuto questo:

    Remote address: 62.152.96.114
    Remote host: ()
    Remote user agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

    cioè non riesco ad ottenere l'host dal numero IP.
    C'e' qualche soluzione per ottenere il nome?

    Grazie!
    Fabio

  2. #2
    Guest

    Predefinito

    Penso che sia una funzione disabilitata, come i socket...

  3. #3
    Guest

    Predefinito

    io l'ho sempre usato e funziona senza problemi

    ciao ^__^

  4. #4
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Codice PHP:
    $IP= $_SERVER['REMOTE_ADDR'];
    $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
    $AGENT= $_SERVER['HTTP_USER_AGENT'];
    $message .= "\nRemote address: $IP";
    $message .= "\nRemote host: $hostname";
    $message .= "\nRemote user agent: $AGENT";
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •