Visualizzazione dei risultati da 1 a 10 su 10
  1. #1

    Script per analisi user-agent

    Ciao a tutti,
    sto cercando uno script o, meglio, una classe o una funzione che mi permetta di conoscere browser, sistema operativo, lingua utilizzata dal browser, ecc.! Ho trovato siti che fanno un'analisi dell'user-agent string (ad esempio http://www.useragentstring.com/), ma non classi o funzioni decenti. Potreste darmi una mano voi, che siete esperti? Sto cercando il meglio del meglio, che mi faccia proprio un'analisi pari a quella del sito da me segnalato!

    Grazie per l'aiuto!
    Earn money for searching the internet:
    Homepages Friends

  2. #2
    up
    Earn money for searching the internet:
    Homepages Friends

  3. #3
    Classe ClientInformation:
    Codice e Demo

    Ciao
    "Melius abundare quam deficere"

  4. #4
    Purtroppo quello che serve a me è qualcosa di più specifico: Browser + Versione del browser
    Earn money for searching the internet:
    Homepages Friends

  5. #5
    Hai trovato una soluzione al tuo problema? a me basta browser + versione

  6. #6
    Purtroppo non ho ancora trovato...
    Earn money for searching the internet:
    Homepages Friends

  7. #7
    Io per il mio script uso questo:

    Codice PHP:
    <?php 
    function agent($browser) {
      
    $useragent $_SERVER['HTTP_USER_AGENT'];
      return 
    strstr($useragent$browser);
      }
      
      function 
    os($opersys) {
      
    $oper $_SERVER['HTTP_USER_AGENT'];
      return 
    strstr($oper$opersys);
      }
    //firefox
    if(agent('Firefox/2') != FALSE) {
        
    $br 'Firefox 2';
    }

    elseif(
    agent('Firefox/1.5') != FALSE) {
        
    $br 'Firefox 1.5';
    }

    elseif(
    agent('Firefox') != FALSE) {
        
    $br 'Firefox';
    }

    elseif(
    agent('GranParadiso') != FALSE) {
        
    $br 'Firefox GranParadiso';
    }
    //AOL
    else if(agent('America Online Browser') != FALSE) {
        
    $br 'AOL';
    }
    //opera
    else if(agent('Opera 5') != FALSE) {
        
    $br 'Opera 5';
    }
    else if(
    agent('Opera/5') != FALSE) {
        
    $br 'Opera 5';
    }
    else if(
    agent('Opera/6') != FALSE) {
        
    $br 'Opera 6';
    }
    else if(
    agent('Opera 6') != FALSE) {
        
    $br 'Opera 6';
    }
    else if(
    agent('Opera/7') != FALSE) {
        
    $br 'Opera 7';
    }
    else if(
    agent('Opera 7') != FALSE) {
        
    $br 'Opera 7';
    }
    //opera

    else if(agent('Safari') != FALSE) {
        
    $br 'Safari';
    }
    //Internet Explorer
    else if(agent('MSIE 2') != FALSE) {
        
    $br 'Internet Explorer 2';
    }
    else if(
    agent('MSIE 3') != FALSE) {
        
    $br 'Internet Explorer 3';
    }
    else if(
    agent('MSIE 4') != FALSE) {
        
    $br 'Internet Explorer 4';
    }
    else if(
    agent('MSIE 5') != FALSE) {
        
    $br 'Internet Explorer 5.5';
    }
    else if(
    agent('MSIE 6') != FALSE) {
        
    $br 'Internet Explorer 6.0';
    }
    else if(
    agent('MSIE 4.5') != FALSE) {
        
    $br 'Internet Explorer 4.5';
    }
    else if(
    agent('MSIE 5.5') != FALSE) {
        
    $br 'Internet Explorer 5.5';
    }
    else if(
    agent('MSIE 7') != FALSE) {
        
    $br 'Internet Explorer 7.0';
    }
    //Internet Explorer
    else if(agent('Lynx') != FALSE) {
        
    $br 'Lynkx';
    }
    else if(
    agent('Links') != FALSE) {
        
    $br 'Links';
    }
    else if(
    agent('amaya') != FALSE) {
        
    $br 'Amaya';
    }
    else if(
    agent('Konqueror') != FALSE) {
        
    $br 'Konqueror';
    }
    else if(
    agent('Epiphany') != FALSE) {
        
    $br 'Epiphany';
    }
    else if(
    agent('Galeon') != FALSE) {
        
    $br 'Galeon';
    }
    else if(
    agent('Avant Browser') != FALSE) {
        
    $br 'Avant Browser';
    }
    else if(
    agent('Wget') != FALSE) {
        
    $br 'Wget';
    }
    else if(
    agent('Firebird') != FALSE) {
        
    $br 'Firebird';
    }
    else if(
    agent('Netscape') != FALSE) {
        
    $br 'Netscape';
    }


        if(
    os('Windows NT 5.1') != FALSE) {
        
    $os 'Windows XP';
        }
        elseif(
    os('Windows') != FALSE) {
        
    $os 'Windows';
        }
          elseif(
    os('Linux') != FALSE) {
        
    $os 'Linux';
        }
          elseif(
    os('MAC') != FALSE) {
        
    $os 'MAC OSX';
        }

    echo 
    "Browser: $br  OS: $os";
    ?>
    T3R4SOFT, il danasoft Italiano e amatoriale. Firme dinamiche per forum e siti.

  8. #8
    Anche io stavo cercando una cosa del genere ma solo rigurado al sistema operativo..Volevo sapere: nel caso il sistema operativo fosse vista?Quale altro elseif bisogna aggiungere?

    if(os('Windows NT 5.1') != FALSE) {
    $os = 'Windows XP';
    }
    elseif(os('Windows') != FALSE) {
    $os = 'Windows';
    }
    elseif(os('Linux') != FALSE) {
    $os = 'Linux';
    }
    elseif(os('MAC') != FALSE) {
    $os = 'MAC OSX';
    }

  9. #9
    Originariamente inviato da Agape
    Anche io stavo cercando una cosa del genere ma solo rigurado al sistema operativo..Volevo sapere: nel caso il sistema operativo fosse vista?Quale altro elseif bisogna aggiungere?

    if(os('Windows NT 5.1') != FALSE) {
    $os = 'Windows XP';
    }
    elseif(os('Windows') != FALSE) {
    $os = 'Windows';
    }
    elseif(os('Linux') != FALSE) {
    $os = 'Linux';
    }
    elseif(os('MAC') != FALSE) {
    $os = 'MAC OSX';
    }
    Appena becco il tipo che ha installato vista gli dico di fare un salto sul mio sito e mandarmi una mail dalla pagina contribuisci, così ti faccio sapere come si identifica vista . Ah, per la cronaca, windows 2000 si identifica come "Windows NT 5.0"
    T3R4SOFT, il danasoft Italiano e amatoriale. Firme dinamiche per forum e siti.

  10. #10
    Windows Vista è "Windows NT 6.0". Provato smanettando con http://www.useragentstring.com/

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.