begin process at 2012 05 27 21:50:36
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Réseau & Internet

 > INFOS LIB

INFOS LIB


 Information sur la source

Note :
9,5 / 10 - par 2 personnes
9,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Réseau & Internet Classé sous :infos, visiteurs, lib, proxy, mini Niveau :Débutant Date de création :27/10/2006 Date de mise à jour :29/10/2006 21:23:52 Vu / téléchargé :6 372 / 375

Auteur : Mini92

Ecrire un message privé
Site perso
Commentaire sur cette source (9)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
Plop all!
Voilà, j'viens de ressortir et réassortir ce script de mes archives ^^

InFos Lib sert à récupérer (à peu prés) toutes les infos utiles sur le client:
IP réelle, Host, Proxy, Host Proxy, Système d'exploitation, Navigateur, Langage navigateur, Referer, Uri..

Sa peut toujours servir et être amélioré à l'occasion ;)

Source

  • <?php
  • //----------------------------<++++++>---------------------------//
  • // InFoS LIB //
  • //---------------------------------------------------------------//
  • // Retourne toutes les infos sur le visiteur //
  • // IP réelle, proxy, host, système, navigateur, langue... //
  • //---------------------------------------------------------------//
  • // Coder par Minimix //
  • // minimix92<arobase>free.fr //
  • //----------------------------<++++++>---------------------------//
  • // >> Retourne l'ip réelle si un proxy est détecté
  • function proxy_detect(){
  • $array = array('HTTP_X_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED_FOR','HTTP_FORWARDED',
  • 'HTTP_VIA','HTTP_X_COMING_FROM','HTTP_COMING_FROM','HTTP_CLIENT_IP' );
  • foreach($array as $key){
  • if(isset($_SERVER[$key]) && !empty($_SERVER[$key])) return $_SERVER[$key];}
  • return NULL;
  • }
  • // >> Retourne l'ip réelle (si elle est détectée)
  • function real_ip_detect(){
  • if($real_ip = proxy_detect()) return $real_ip;
  • else return $_SERVER['REMOTE_ADDR'];
  • }
  • // >> Retourne l'host réelle (si il est détecté)
  • function real_host_detect(){
  • if($real_ip = proxy_detect()) return @gethostbyaddr($real_ip);
  • else return @gethostbyaddr($_SERVER['REMOTE_ADDR']);
  • }
  • // >> Retourne l'IP du proxy (si elle est detectée)
  • function proxy_ip__detect(){
  • if(proxy_detect()) return $_SERVER['REMOTE_ADDR'];
  • else return FALSE;
  • }
  • // >> Retourne l'host du proxy (si il est detecté)
  • function proxy_host_detect(){
  • if(proxy_detect()) return @gethostbyaddr($_SERVER['REMOTE_ADDR']);
  • else return FALSE;
  • }
  • // >> Retourne le système d'exploitation (OS)
  • function system_detect(){
  • $array = array('(win|windows) ?(9x ?4\.90|Me)' => 'Windows ME',
  • '(win|windows) ?(98)' => 'Windows 98',
  • '(win|windows) ?(2000)' => 'Windows 2000',
  • '(win|windows) ?(95)' => 'Windows 95',
  • '(win|windows) ?NT ?(5\.1|6(\.0)?)' => 'Windows XP',
  • '(win|windows) ?NT ?(5(\.0)?)' => 'Windows NT',
  • '(win|windows) ?VISTA' => 'Windows VISTA',
  • '(win|windows) ?XP ?(LSD)' => 'Windows LSD',
  • '(win|windows) ?XP' => 'Windows XP',
  • '(win|windows)' => 'Windows',
  • '(linux)' => 'Linux',
  • 'SunOs' => 'SunOs',
  • '(freebsd)' => 'FreeBSD',
  • '(openbsd)' => 'OpenBS',
  • '(netbsd)' => 'NetBSD',
  • '(AIX)' => 'AIX',
  • '(QNX)' => 'QNX',
  • '(HP-UX)' => 'HP-UX',
  • '(IRIX)' => 'IRIX',
  • '(unix|x11)' => 'UNIX',
  • '(Macintosh|PPC)' => 'Macintosh',
  • '(mac|ppc)' => 'Macintosh',
  • 'beos' => 'BeOS',
  • 'os/2' => 'OS/2'
  • );
  • foreach($array as $reg => $system){
  • if(eregi($reg, $_SERVER['HTTP_USER_AGENT'])) return $system;}
  • return 'Inconnu';
  • }
  • // >> Retourne le navigateur
  • function browser_detect(){
  • $array = array('(MSIE)' => 'Internet Explorer',
  • '(Firefox)' => 'Mozilla Firefox',
  • '(Mozilla)' => 'Mozilla',
  • '(Opera)' => 'Opera',
  • '(Netscape)' => 'Netscape',
  • '(AOL)' => 'AOL',
  • '(Konqueror)' => 'Konqueror',
  • '(Lynx)' => 'Lynx',
  • '(Amaya)' => 'Amaya',
  • '(AvantGo)' => 'AvantGo',
  • '(Bluefish)' => 'Bluefish',
  • '(ICEBrowser)' => 'ICEBrowser',
  • '(Safari)' => 'Safari',
  • '(Kanari)' => 'Kanari',
  • '(ICEBrowser)' => 'ICEBrowser',
  • '(bot|google|slurp|scooter|spider|infoseek|arachnoidea|altavista)' => 'Search engine',
  • 'tv' => 'Web TV'
  • );
  • foreach($array as $reg => $browser){
  • if(eregi($reg, $_SERVER['HTTP_USER_AGENT'])) return $browser;}
  • return 'Inconnu';
  • }
  • // >> Retourne le code language utilisé par l'explorateur
  • function language_detect(){
  • $language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
  • $lang_list = array('AF','SQ','DE','EN','AR','AN','HY','AS','AST','AZ','EU','BN','BE','BS','BR','PTBR','BG','KM','CA','CH','ZH','KO','CO','HR','DA','ES','EO','ET','FJ','FI','FR','HT','HE','HU','HI','ID','GA','IS','IT','JA','LA','LT','MK','MS','MO','NL','NE','NO','PA','FA','PL','PT','RO','RU','SR','SRCYR','SK','SL','SV','CS','CE','TH','UK','VI','YI');
  • $accept_lang = explode(',', $language);
  • reset($accept_lang);
  • while(list($index, $lang) = @each($accept_lang)) {
  • if(eregi("^(.+);q=([0-9.]*)$", $lang, $reg))
  • $accept_lang[$index] = $reg[2].';'.strtoupper($reg[1]);
  • else
  • $accept_lang[$index] = '1.0;'.strtoupper($accept_lang[$index]); }
  • arsort($accept_lang);
  • reset($accept_lang);
  • while(list(, $alang) = @each($accept_lang)) {
  • reset($lang_list);
  • while(list(, $lng) = @each($lang_list)) {
  • if(strpos($alang, $lng)!=0) {
  • $the_lang = $lng;
  • break 2; } } }
  • unset($accept_lang, $alang, $lng);
  • return $the_lang;
  • }
  • // >> Retourne la langue par rapport à son code
  • function language_convert($lang=''){
  • $array = array('AF' => 'Afrikaans',
  • 'SQ' => 'Albanais',
  • 'DE' => 'Allemand',
  • 'EN' => 'Anglais',
  • 'AR' => 'Arabe',
  • 'AN' => 'Aragonais',
  • 'HY' => 'Arménien',
  • 'AS' => 'Assamais',
  • 'AST' => 'Asturien',
  • 'AZ' => 'Azéri',
  • 'EU' => 'Basque',
  • 'BN' => 'Bengali',
  • 'BE' => 'Biélorusse',
  • 'BS' => 'Bosniaque',
  • 'PTBR' => 'Brézil',
  • 'BR' => 'Brézil',
  • 'BG' => 'Bulgare',
  • 'KM' => 'Cambodgien',
  • 'CA' => 'Catalan',
  • 'CH' => 'Chamaroo',
  • 'ZH' => 'Chinois',
  • 'KO' => 'Coréen',
  • 'CO' => 'Corse',
  • 'HR' => 'Croate',
  • 'DA' => 'Danois',
  • 'ES' => 'Espagnol',
  • 'EO' => 'Espéranto',
  • 'ET' => 'Estonien',
  • 'FJ' => 'Fidjien',
  • 'FR' => 'Français',
  • 'HT' => 'Haïtien',
  • 'HE' => 'Hébreu',
  • 'HU' => 'Hongrois',
  • 'HI' => 'Hindi',
  • 'ID' => 'Indonésien',
  • 'GA' => 'Irlandais',
  • 'IS' => 'Islandais',
  • 'IT' => 'Italien',
  • 'JA' => 'Japonais',
  • 'LA' => 'Latin',
  • 'LT' => 'Lituanien',
  • 'MK' => 'Macédoine',
  • 'MS' => 'Malais',
  • 'MO' => 'Moldave',
  • 'NL' => 'Néerlandais',
  • 'NE' => 'Népalais',
  • 'NO' => 'Norvégiens',
  • 'PA' => 'Penjabi',
  • 'FA' => 'Persan',
  • 'PL' => 'Polonais',
  • 'PT' => 'Portuguais',
  • 'RO' => 'Roumain',
  • 'RU' => 'Russe',
  • 'SRCYR'=> 'Serbe',
  • 'SR' => 'Serbe',
  • 'SK' => 'Slovaque',
  • 'SL' => 'Slovène',
  • 'SV' => 'Suédois',
  • 'CS' => 'Tchèque',
  • 'CE' => 'Tchétchène',
  • 'TH' => 'Thaï',
  • 'TR' => 'Turque',
  • 'UK' => 'Ukrainien',
  • 'VI' => 'Vietnamien',
  • 'YI' => 'Yiddish',
  • );
  • foreach($array as $reg => $language){
  • if($lang == $reg) return $language;}
  • return 'Inconnu';
  • }
  • // >> Retourne le port d'écoute
  • function port_detect(){
  • if(!empty($_SERVER['REMOTE_PORT'])) return $_SERVER['REMOTE_PORT'];
  • else return 'Inconnu';
  • }
  • // >> Retourne la provenance
  • function referer_detect(){
  • if(!empty($_SERVER['HTTP_REFERER'])) return $_SERVER['HTTP_REFERER'];
  • else return 'Inconnu';
  • }
  • // >> Retourne le lien demandé
  • function uri_detect(){
  • if(!empty($_SERVER['REQUEST_URI'])) return 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
  • else return 'Inconnu';
  • }
  • // >> Affiche les infos client
  • function view_infos_client(){
  • $info = proxy_detect();
  • echo '<style>';
  • echo 'body { background-color:#CCCCCC; font-family:Courier new; font-weight:bold; text-align:center; }';
  • echo 'th { background-color:#999999; border:1px solid #2D2D2D; color:#2D2D2D; font-family:Courier New; font-size:15px; font-weight:bold; text-align:center; }';
  • echo 'td { background-color:#2D2D2D; color:#FFFFFF; font-family:"Lucida Console", Courier, monospace; font-size:13px; }';
  • echo '</style>';
  • echo '<br />';
  • echo '<br />';
  • echo '<table align="center" border="0" cellpadding="4" cellspacing="0">';
  • echo '<tbody>';
  • echo '<tr><th colspan="2"><u>Le '.date('d/m/Y').' à '.date('H:i:s').'</u></th></tr>';
  • if(!empty($info)){
  • echo '<tr><td><b>Proxy IP</b></td><td align="left">: ' .proxy_ip__detect(). '</td></tr>';
  • echo '<tr><td><b>Hostname</b></td><td align="left">: ' .proxy_host_detect(). '</td></tr>'; }
  • echo '<tr><td><b>Real IP </b></td><td align="left">: ' .real_ip_detect(). '</td></tr>';
  • echo '<tr><td><b>Hostname</b></td><td align="left">: ' .real_host_detect(). '</td></tr>';
  • echo '<tr><td><b>Port </b></td><td align="left">: ' .port_detect(). '</td></tr>';
  • echo '<tr><td><b>System </b></td><td align="left">: ' .system_detect(). '</td></tr>';
  • echo '<tr><td><b>Browser </b></td><td align="left">: ' .browser_detect(). '</td></tr>';
  • echo '<tr><td><b>Language</b></td><td align="left">: ' .language_convert(language_detect()). '</td></tr>';
  • echo '<tr><td><b>Referer </b></td><td align="left">: ' .referer_detect(). '</td></tr>';
  • echo '<tr><td><b>Uri </b></td><td align="left">: ' .uri_detect(). '</td></tr>';
  • echo '</tbody>';
  • echo '</table>';
  • echo '<br />';
  • echo '<br />';
  • echo '- InFoS LIB - <br />';
  • echo '- Coded by Minimix -';
  • }
  • // >> Recupère les infos client dans le fichier $log_file
  • function log_infos($log_file){
  • if($fp = @fopen($log_file, 'w')){
  • unset($info);
  • $info = proxy_detect();
  • $buf = "Le ".date('d/m/Y')." à ".date('H:i:s')."\n\n";
  • if(!empty($info)){
  • $buf .= "Proxy IP : " .proxy_ip__detect(). "\n";
  • $buf .= "Hostname : " .proxy_host_detect(). "\n"; }
  • $buf .= "Real IP : " .real_ip_detect(). "\n";
  • $buf .= "Hostname : " .real_host_detect(). "\n";
  • $buf .= "Port : " .port_detect(). "\n";
  • $buf .= "System : " .system_detect(). "\n";
  • $buf .= "Browser : " .browser_detect(). "\n";
  • $buf .= "Language : " .language_convert(language_detect()). "\n";
  • $buf .= "Referer : " .referer_detect(). "\n";
  • $buf .= "Uri : " .uri_detect(). "\n";
  • if(@fputs($fp, $buf)) {
  • @fclose($fp);
  • return TRUE; }}
  • @fclose($fp);
  • return FALSE;
  • }
  • //----------------------------<++++++>----------------------------//
  • // EnD Of InFoS LIB //
  • //----------------------------------------------------------------//
  • ?>
<?php

//----------------------------<++++++>---------------------------//
//                           InFoS LIB                           //
//---------------------------------------------------------------//
//           Retourne toutes les infos sur le visiteur           //
//     IP réelle, proxy, host, système, navigateur, langue...    //
//---------------------------------------------------------------//
//                       Coder par Minimix                       //
//                   minimix92<arobase>free.fr                   //
//----------------------------<++++++>---------------------------//


// >> Retourne l'ip réelle si un proxy est détecté
function proxy_detect(){
  $array = array('HTTP_X_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED_FOR','HTTP_FORWARDED',
                 'HTTP_VIA','HTTP_X_COMING_FROM','HTTP_COMING_FROM','HTTP_CLIENT_IP'            );
  foreach($array as $key){
    if(isset($_SERVER[$key]) && !empty($_SERVER[$key])) return $_SERVER[$key];}
  return NULL;
  }


// >> Retourne l'ip réelle (si elle est détectée)
function real_ip_detect(){
  if($real_ip = proxy_detect()) return $real_ip;
  else                          return $_SERVER['REMOTE_ADDR'];
  }


// >> Retourne l'host réelle (si il est détecté)
function real_host_detect(){
  if($real_ip = proxy_detect()) return @gethostbyaddr($real_ip);
  else                          return @gethostbyaddr($_SERVER['REMOTE_ADDR']);
  }


// >> Retourne l'IP du proxy (si elle est detectée)
function proxy_ip__detect(){
  if(proxy_detect()) return $_SERVER['REMOTE_ADDR'];
  else               return FALSE;
  }


// >> Retourne l'host du proxy (si il est detecté)
function proxy_host_detect(){
  if(proxy_detect()) return @gethostbyaddr($_SERVER['REMOTE_ADDR']);
  else               return FALSE;
  }


// >> Retourne le système d'exploitation (OS)
function system_detect(){
  $array = array('(win|windows) ?(9x ?4\.90|Me)'     => 'Windows ME',
                 '(win|windows) ?(98)'               => 'Windows 98',
                 '(win|windows) ?(2000)'             => 'Windows 2000',
                 '(win|windows) ?(95)'               => 'Windows 95',
                 '(win|windows) ?NT ?(5\.1|6(\.0)?)' => 'Windows XP',
                 '(win|windows) ?NT ?(5(\.0)?)'      => 'Windows NT',
                 '(win|windows) ?VISTA'              => 'Windows VISTA',
                 '(win|windows) ?XP ?(LSD)'          => 'Windows LSD',
                 '(win|windows) ?XP'                 => 'Windows XP',
                 '(win|windows)'                     => 'Windows',
                 '(linux)'                           => 'Linux',
                 'SunOs'                             => 'SunOs',
                 '(freebsd)'                         => 'FreeBSD',
                 '(openbsd)'                         => 'OpenBS',
                 '(netbsd)'                          => 'NetBSD',
                 '(AIX)'                             => 'AIX',
                 '(QNX)'                             => 'QNX',
                 '(HP-UX)'                           => 'HP-UX',
                 '(IRIX)'                            => 'IRIX',
                 '(unix|x11)'                        => 'UNIX',
                 '(Macintosh|PPC)'                   => 'Macintosh',
                 '(mac|ppc)'                         => 'Macintosh',
                 'beos'                              => 'BeOS',
                 'os/2'                              => 'OS/2'
                );
  foreach($array as $reg => $system){
  if(eregi($reg, $_SERVER['HTTP_USER_AGENT']))  return $system;}
  return 'Inconnu';
  }


// >> Retourne le navigateur
function browser_detect(){
  $array = array('(MSIE)'       => 'Internet Explorer',
                 '(Firefox)'    => 'Mozilla Firefox',
                 '(Mozilla)'    => 'Mozilla',
                 '(Opera)'      => 'Opera',
                 '(Netscape)'   => 'Netscape',
                 '(AOL)'        => 'AOL',
                 '(Konqueror)'  => 'Konqueror',
                 '(Lynx)'       => 'Lynx',
                 '(Amaya)'      => 'Amaya',
                 '(AvantGo)'    => 'AvantGo',
                 '(Bluefish)'   => 'Bluefish',
                 '(ICEBrowser)' => 'ICEBrowser',
                 '(Safari)'     => 'Safari',
                 '(Kanari)'     => 'Kanari',
                 '(ICEBrowser)' => 'ICEBrowser',
                 '(bot|google|slurp|scooter|spider|infoseek|arachnoidea|altavista)' => 'Search engine',
                 'tv'           => 'Web TV'
                );
  foreach($array as $reg => $browser){
  if(eregi($reg, $_SERVER['HTTP_USER_AGENT']))  return $browser;}
  return 'Inconnu';
  }


// >> Retourne le code language utilisé par l'explorateur
function language_detect(){
  $language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
  $lang_list = array('AF','SQ','DE','EN','AR','AN','HY','AS','AST','AZ','EU','BN','BE','BS','BR','PTBR','BG','KM','CA','CH','ZH','KO','CO','HR','DA','ES','EO','ET','FJ','FI','FR','HT','HE','HU','HI','ID','GA','IS','IT','JA','LA','LT','MK','MS','MO','NL','NE','NO','PA','FA','PL','PT','RO','RU','SR','SRCYR','SK','SL','SV','CS','CE','TH','UK','VI','YI');
  $accept_lang = explode(',', $language);
  reset($accept_lang);
  while(list($index, $lang) = @each($accept_lang)) {
  if(eregi("^(.+);q=([0-9.]*)$", $lang, $reg))
  $accept_lang[$index] = $reg[2].';'.strtoupper($reg[1]);
  else
  $accept_lang[$index] = '1.0;'.strtoupper($accept_lang[$index]); }
  arsort($accept_lang);
  reset($accept_lang);
  while(list(, $alang) = @each($accept_lang)) {
  reset($lang_list);
  while(list(, $lng) = @each($lang_list)) {
  if(strpos($alang, $lng)!=0) {
  $the_lang = $lng;
  break 2; } } }
  unset($accept_lang, $alang, $lng);
  return $the_lang;
  }


// >> Retourne la langue par rapport à son code
function language_convert($lang=''){
  $array = array('AF'   => 'Afrikaans',
                 'SQ'   => 'Albanais',
                 'DE'   => 'Allemand',
                 'EN'   => 'Anglais',
                 'AR'   => 'Arabe',
                 'AN'   => 'Aragonais',
                 'HY'   => 'Arménien',
                 'AS'   => 'Assamais',
                 'AST'  => 'Asturien',
                 'AZ'   => 'Azéri',
                 'EU'   => 'Basque',
                 'BN'   => 'Bengali',
                 'BE'   => 'Biélorusse',
                 'BS'   => 'Bosniaque',
                 'PTBR' => 'Brézil',
                 'BR'   => 'Brézil',
                 'BG'   => 'Bulgare',
                 'KM'   => 'Cambodgien',
                 'CA'   => 'Catalan',
                 'CH'   => 'Chamaroo',
                 'ZH'   => 'Chinois',
                 'KO'   => 'Coréen',
                 'CO'   => 'Corse',
                 'HR'   => 'Croate',
                 'DA'   => 'Danois',
                 'ES'   => 'Espagnol',
                 'EO'   => 'Espéranto',
                 'ET'   => 'Estonien',
                 'FJ'   => 'Fidjien',
                 'FR'   => 'Français',
                 'HT'   => 'Haïtien',
                 'HE'   => 'Hébreu',
                 'HU'   => 'Hongrois',
                 'HI'   => 'Hindi',
                 'ID'   => 'Indonésien',
                 'GA'   => 'Irlandais',
                 'IS'   => 'Islandais',
                 'IT'   => 'Italien',
                 'JA'   => 'Japonais',
                 'LA'   => 'Latin',
                 'LT'   => 'Lituanien',
                 'MK'   => 'Macédoine',
                 'MS'   => 'Malais',
                 'MO'   => 'Moldave',
                 'NL'   => 'Néerlandais',
                 'NE'   => 'Népalais',
                 'NO'   => 'Norvégiens',
                 'PA'   => 'Penjabi',
                 'FA'   => 'Persan',
                 'PL'   => 'Polonais',
                 'PT'   => 'Portuguais',
                 'RO'   => 'Roumain',
                 'RU'   => 'Russe',
                 'SRCYR'=> 'Serbe',
                 'SR'   => 'Serbe',
                 'SK'   => 'Slovaque',
                 'SL'   => 'Slovène',
                 'SV'   => 'Suédois',
                 'CS'   => 'Tchèque',
                 'CE'   => 'Tchétchène',
                 'TH'   => 'Thaï',
                 'TR'   => 'Turque',
                 'UK'   => 'Ukrainien',
                 'VI'   => 'Vietnamien',
                 'YI'   => 'Yiddish',
                );
  foreach($array as $reg => $language){
  if($lang == $reg)  return $language;}
  return 'Inconnu';
  }



// >> Retourne le port d'écoute
function port_detect(){
  if(!empty($_SERVER['REMOTE_PORT'])) return $_SERVER['REMOTE_PORT'];
  else                                return 'Inconnu';
  }


// >> Retourne la provenance
function referer_detect(){
  if(!empty($_SERVER['HTTP_REFERER'])) return $_SERVER['HTTP_REFERER'];
  else                                 return 'Inconnu';
  }


// >> Retourne le lien demandé
function uri_detect(){
  if(!empty($_SERVER['REQUEST_URI'])) return 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
  else                                return 'Inconnu';
  }


// >> Affiche les infos client
function view_infos_client(){
  $info = proxy_detect();
  echo '<style>';
  echo 'body { background-color:#CCCCCC; font-family:Courier new; font-weight:bold; text-align:center; }';
  echo 'th { background-color:#999999; border:1px solid #2D2D2D; color:#2D2D2D; font-family:Courier New; font-size:15px; font-weight:bold; text-align:center; }';
  echo 'td { background-color:#2D2D2D; color:#FFFFFF; font-family:"Lucida Console", Courier, monospace; font-size:13px; }';
  echo '</style>';
  echo '<br />';
  echo '<br />';
  echo '<table align="center" border="0" cellpadding="4" cellspacing="0">';
  echo '<tbody>';
  echo '<tr><th colspan="2"><u>Le '.date('d/m/Y').' à '.date('H:i:s').'</u></th></tr>';
  if(!empty($info)){
  echo '<tr><td><b>Proxy IP</b></td><td align="left">: ' .proxy_ip__detect().  '</td></tr>';
  echo '<tr><td><b>Hostname</b></td><td align="left">: ' .proxy_host_detect(). '</td></tr>'; }
  echo '<tr><td><b>Real IP </b></td><td align="left">: ' .real_ip_detect().    '</td></tr>';
  echo '<tr><td><b>Hostname</b></td><td align="left">: ' .real_host_detect().  '</td></tr>';
  echo '<tr><td><b>Port    </b></td><td align="left">: ' .port_detect().       '</td></tr>';
  echo '<tr><td><b>System  </b></td><td align="left">: ' .system_detect().     '</td></tr>';
  echo '<tr><td><b>Browser </b></td><td align="left">: ' .browser_detect().    '</td></tr>';
  echo '<tr><td><b>Language</b></td><td align="left">: ' .language_convert(language_detect()). '</td></tr>';
  echo '<tr><td><b>Referer </b></td><td align="left">: ' .referer_detect().    '</td></tr>';
  echo '<tr><td><b>Uri     </b></td><td align="left">: ' .uri_detect().        '</td></tr>';
  echo '</tbody>';
  echo '</table>';
  echo '<br />';
  echo '<br />';
  echo '- InFoS LIB - <br />';
  echo '- Coded by Minimix -';
  }


// >> Recupère les infos client dans le fichier $log_file
function log_infos($log_file){
  if($fp = @fopen($log_file, 'w')){
  unset($info);
  $info = proxy_detect();
  $buf  = "Le ".date('d/m/Y')." à ".date('H:i:s')."\n\n";
  if(!empty($info)){
  $buf .= "Proxy IP : " .proxy_ip__detect().  "\n";
  $buf .= "Hostname : " .proxy_host_detect(). "\n"; }
  $buf .= "Real IP  : " .real_ip_detect().    "\n";
  $buf .= "Hostname : " .real_host_detect().  "\n";
  $buf .= "Port     : " .port_detect().       "\n";
  $buf .= "System   : " .system_detect().     "\n";
  $buf .= "Browser  : " .browser_detect().    "\n";
  $buf .= "Language : " .language_convert(language_detect()). "\n";
  $buf .= "Referer  : " .referer_detect().    "\n";
  $buf .= "Uri      : " .uri_detect().        "\n";
  if(@fputs($fp, $buf)) {
  @fclose($fp);
  return TRUE; }}
  @fclose($fp);
  return FALSE;
  }

//----------------------------<++++++>----------------------------//
//                        EnD Of InFoS LIB                        //
//----------------------------------------------------------------//

?>

 Conclusion

Utilisation:

include('infos.lib.php');

// Affiche toutes les infos à savoir sur le client
view_infos_client();

// Affiche l'IP du proxy si elle est detectée
if($proxy_ip = proxy_ip__detect())
echo "Proxy IP : $proxy_ip<br />";

// Affiche la "vraie" IP si elle est detectée
if($real_ip = real_ip_detect())
echo "Real IP : $real_ip<br />";

// ...

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Historique

29 octobre 2006 21:23:52 :
- Suite à la réponse de FhX j'ai modifié quelques fonctions ;)

 Sources du même auteur

Source avec Zip Source avec une capture FILE SPLITTER 0.2
FONCTION FIND PROXY
Source avec Zip Source avec une capture PROXYLISTER

 Sources de la même categorie

INSPECTEUR DE PAGES (VÉRIFIEZ SI DES SITES AFFICHENT UN TEXT... par pablo836
Source avec Zip Source avec une capture GÉOLOCALISATION par pgl10
Source avec Zip TAPI : METTRE EN RELATION DEUX POSTES TELEPHONIQUES par ravery
Source avec Zip CLIENT / SERVEUR : LES SOCKETS par Morphinof
Source avec Zip VALIDATEUR_3WC par lezj

 Sources en rapport avec celle ci

Source avec Zip CREATED SOME TINY URL par ledamss
Source avec Zip Source avec une capture MESVISITEURS par pgl10
OPERATING SYSTEM DETECTION par tex73
FONCTION FIND PROXY par Mini92
AFFICHER DES INFORMATIONS CONCERNANT LE VISITEUR par spidermario

Commentaires et avis

Commentaire de iow4 le 27/10/2006 13:58:16

Une jolie faute dans l'exemple : echo est une instruction elle doit se terminer par ;

Commentaire de Mini92 le 27/10/2006 14:18:18

Il est vrai :p
j'ai donné l'exemple à la va vite.

Commentaire de FhX le 29/10/2006 18:31:36

#  elseif(!empty($_SERVER['HTTP_X_FORWARDED'])) $proxy = $_SERVER['HTTP_X_FORWARDED'];
# elseif(!empty($_SERVER['HTTP_FORWARDED_FOR'])) $proxy = $_SERVER['HTTP_FORWARDED_FOR'];
# elseif(!empty($_SERVER['HTTP_FORWARDED'])) $proxy = $_SERVER['HTTP_FORWARDED'];
# elseif(!empty($_SERVER['HTTP_VIA'])) $proxy = $_SERVER['HTTP_VIA'];
# elseif(!empty($_SERVER['HTTP_X_COMING_FROM'])) $proxy = $_SERVER['HTTP_X_COMING_FROM'];
# elseif(!empty($_SERVER['HTTP_COMING_FROM'])) $proxy = $_SERVER['HTTP_COMING_FROM'];
# elseif(!empty($_SERVER['HTTP_CLIENT_IP'])) $proxy = $_SERVER['HTTP_CLIENT_IP'];

Heureusement qu'on a créé les tableaux !!
function Search() {
$array = array('HTTP_X....', 'HTTP_X....', .....);
foreach ($array as $key) {
          if ( isset($_SERVER[$key]) && !empty($_SERVER[$key]) ) return $_SERVER[$key];
}
return NULL;
}

$proxy = Search();

// Et hop, c'est remballé lol !

Pareil pour eregi() ... !

language_convert() aussi ..
function convert($key) {
$array = array('FR' => 'Francais', ....);
return $array[$key];
}
Et zoup ! :)

Bref, c'est à revoir !

Commentaire de Mini92 le 29/10/2006 19:59:48

Merci FhX sa va bien réduire le script tout ça ;)
C'est noté!

Commentaire de Astalavista le 13/12/2006 14:12:08

Très bien fait, une petite modif a fair :
function language_convert($lang=''){
$array = array('AF' => 'Afrikaans',
'SQ' => 'Albanais',
...
'YI' => 'Yiddish',
);
if(array_key_exists($lang, $array))
return $array[$lang];
return 'Inconnu';
}

Commentaire de Mini92 le 31/01/2007 13:30:49

Exact Astalavista, sa evite une boucle inutile ;)

Commentaire de dpotuznik le 10/05/2007 09:01:20

a mon avis dans browser_detect()
il faut deplacer '(Mozilla)'    => 'Mozilla', ver la fin car si on regarde la ligne pour safari

"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3"
on remarque qu'elle commence par "Mozilla" donc le script va s'arreter la.

sinon excellent
merci.

Commentaire de lvl_king le 12/07/2008 01:48:13

pourquoi il ne marche pas :s

Commentaire de louisdsm le 12/07/2009 14:40:28

Bonjour je suis nouveau mais le script qui est sur la page la en php ou doije le mettre si je veut l'inclure dans un site en html, est ceque je le mais ds toutes les pages ou ??
Merci de bien vouloire me répondre

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

fopen & proxy [ par thierry ] Bonjour à tous et à toutes !Je tente d'utiliser la fonction fopen en ouvrant une page web par exemple. Seulement voila mon pb. Chez moi ca marche très DONNER DES INFOS SUR LE VISITEUR [ par kindool ] Bonjour, je recherche tout type de code php donnant des infos sur le visiteur du site, si vous en connaissez, merci de me répondre :)genre d'infos rec Apache comme proxy ? [ par Clem ] J'ai vu que il est possible d'utiliser Apache comme serveur proxy, mais je n'y arrive pas. Pouvez-vous m'aider ? urgent..DB.php lib [ par fatNugly ] bonjourquelqu'un aurait il une idee ou je pourrais trouverla class DB.php SVP c'est urgent et je suis legerement dans le caca!!merci aux ames chari Avoir des infos sur un user [ par Yuleesize ] Ehh bjr. En fait j'aimerait bien savoir komment on fé pour avoir des infos sur l'user... Comme par ex l'host... l'os... le navigateur... etc... En fai Forum : comment ca marche ? [ par BSide ] BSideBonjour,pouvez-vous m'expliquer comment fonctionne un forum ?Plus précisément : je souhaite afficher sous forme de tableau le contenu d'une BD ma Pclzip [ par ultranono ] Salut,pour zipper un fichier g utiliser le fichier pclzip.lib.phpet j'ai le message d'erreur suivant : -------------------------Abort pclzip.lib.php : récuperer des infos sur un site web [ par nunor ] Bonjour,Je débute en PHP.Je souhaiterais savoir s'il est possible de récupérer dans une base de données différentes informations. Ces informations son récuperer des infos sur un site web [ par nunor ] Bonjour,Je débute en PHP.Je souhaiterais savoir s'il est possible de récupérer dans une base de données différentes informations. Ces informations son


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,359 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales