Accueil > > > OPERATING SYSTEM DETECTION
OPERATING SYSTEM DETECTION
Information sur la source
Description
une fonction qui peut s'averer utile lors du tracking de vos visiteurs en vos indiquant le systeme d'exploitation de ces derniers.
Source
- /* return Operating System */
- function operating_system_detection(){
- if ( isset( $_SERVER ) ) {
- $agent = $_SERVER['HTTP_USER_AGENT'] ;
- }
- else {
- global $HTTP_SERVER_VARS ;
- if ( isset( $HTTP_SERVER_VARS ) ) {
- $agent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ;
- }
- else {
- global $HTTP_USER_AGENT ;
- $agent = $HTTP_USER_AGENT ;
- }
- }
- $ros[] = array('Windows XP', 'Windows XP');
- $ros[] = array('Windows NT 5.1|Windows NT5.1)', 'Windows XP');
-
- $ros[] = array('Windows 2000', 'Windows 2000');
- $ros[] = array('Windows NT 5.0', 'Windows 2000');
- $ros[] = array('Windows NT 4.0|WinNT4.0', 'Windows NT');
-
- $ros[] = array('Windows NT 5.2', 'Windows Server 2003');
- $ros[] = array('Windows NT 6.0', 'Windows Vista');
-
- $ros[] = array('Windows CE', 'Windows CE');
- $ros[] = array('(media center pc).([0-9]{1,2}\.[0-9]{1,2})', 'Windows Media Center');
-
- $ros[] = array('(win)([0-9]{1,2}\.[0-9x]{1,2})', 'Windows');
- $ros[] = array('(win)([0-9]{2})', 'Windows');
- $ros[] = array('(windows)([0-9x]{2})', 'Windows');
-
- // Doesn't seem like these are necessary...not totally sure though..
- //$ros[] = array('(winnt)([0-9]{1,2}\.[0-9]{1,2}){0,1}', 'Windows NT');
- //$ros[] = array('(windows nt)(([0-9]{1,2}\.[0-9]{1,2}){0,1})', 'Windows NT'); // fix by bg
-
- $ros[] = array('Windows ME', 'Windows ME');
- $ros[] = array('Win 9x 4.90', 'Windows ME');
- $ros[] = array('Windows 98|Win98', 'Windows 98');
- $ros[] = array('Windows 95', 'Windows 95');
- $ros[] = array('(windows)([0-9]{1,2}\.[0-9]{1,2})', 'Windows');
- $ros[] = array('win32', 'Windows');
-
- $ros[] = array('(java)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})', 'Java');
- $ros[] = array('(Solaris)([0-9]{1,2}\.[0-9x]{1,2}){0,1}', 'Solaris');
- $ros[] = array('dos x86', 'DOS');
- $ros[] = array('unix', 'Unix');
-
- $ros[] = array('Mac OS X', 'Mac OS X');
- $ros[] = array('Mac_PowerPC', 'Macintosh PowerPC');
- $ros[] = array('(mac|Macintosh)', 'Mac OS');
-
- $ros[] = array('(sunos)([0-9]{1,2}\.[0-9]{1,2}){0,1}', 'SunOS');
- $ros[] = array('(beos)([0-9]{1,2}\.[0-9]{1,2}){0,1}', 'BeOS');
- $ros[] = array('(risc os)([0-9]{1,2}\.[0-9]{1,2})', 'RISC OS');
- $ros[] = array('os/2', 'OS/2');
- $ros[] = array('freebsd', 'FreeBSD');
- $ros[] = array('openbsd', 'OpenBSD');
- $ros[] = array('netbsd', 'NetBSD');
- $ros[] = array('irix', 'IRIX');
- $ros[] = array('plan9', 'Plan9');
- $ros[] = array('osf', 'OSF');
- $ros[] = array('aix', 'AIX');
- $ros[] = array('GNU Hurd', 'GNU Hurd');
-
-
- $ros[] = array('(fedora)', 'Linux - Fedora');
- $ros[] = array('(kubuntu)', 'Linux - Kubuntu');
- $ros[] = array('(ubuntu)', 'Linux - Ubuntu');
- $ros[] = array('(debian)', 'Linux - Debian');
- $ros[] = array('(CentOS)', 'Linux - CentOS');
- $ros[] = array('(Mandriva).([0-9]{1,3}(\.[0-9]{1,3})?(\.[0-9]{1,3})?)', 'Linux - Mandriva');
- $ros[] = array('(SUSE).([0-9]{1,3}(\.[0-9]{1,3})?(\.[0-9]{1,3})?)', 'Linux - SUSE');
- $ros[] = array('(Dropline)', 'Linux - Slackware (Dropline GNOME)');
- $ros[] = array('(ASPLinux)', 'Linux - ASPLinux');
- $ros[] = array('(Red Hat)', 'Linux - Red Hat');
-
- // Loads of Linux machines will be detected as unix.
- // Actually, all of the linux machines I've checked have the 'X11' in the User Agent.
- //$ros[] = array('X11', 'Unix');
-
- $ros[] = array('(linux)', 'Linux');
-
- $ros[] = array('(amigaos)([0-9]{1,2}\.[0-9]{1,2})', 'AmigaOS');
- $ros[] = array('amiga-aweb', 'AmigaOS');
- $ros[] = array('amiga', 'Amiga');
- $ros[] = array('AvantGo', 'PalmOS');
-
- //$ros[] = array('(Linux)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}(rel\.[0-9]{1,2}){0,1}-([0-9]{1,2}) i([0-9]{1})86){1}', 'Linux');
- //$ros[] = array('(Linux)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}(rel\.[0-9]{1,2}){0,1} i([0-9]{1}86)){1}', 'Linux');
- //$ros[] = array('(Linux)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}(rel\.[0-9]{1,2}){0,1})', 'Linux');
- $ros[] = array('[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3})', 'Linux');
-
- $ros[] = array('(webtv)/([0-9]{1,2}\.[0-9]{1,2})', 'WebTV');
- $ros[] = array('Dreamcast', 'Dreamcast OS');
- $ros[] = array('GetRight', 'Windows');
- $ros[] = array('go!zilla', 'Windows');
- $ros[] = array('gozilla', 'Windows');
- $ros[] = array('gulliver', 'Windows');
- $ros[] = array('ia archiver', 'Windows');
- $ros[] = array('NetPositive', 'Windows');
- $ros[] = array('mass downloader', 'Windows');
- $ros[] = array('microsoft', 'Windows');
- $ros[] = array('offline explorer', 'Windows');
- $ros[] = array('teleport', 'Windows');
- $ros[] = array('web downloader', 'Windows');
- $ros[] = array('webcapture', 'Windows');
- $ros[] = array('webcollage', 'Windows');
- $ros[] = array('webcopier', 'Windows');
- $ros[] = array('webstripper', 'Windows');
- $ros[] = array('webzip', 'Windows');
- $ros[] = array('wget', 'Windows');
- $ros[] = array('Java', 'Unknown');
- $ros[] = array('flashget', 'Windows');
-
- // delete next line if the script show not the right OS
- //$ros[] = array('(PHP)/([0-9]{1,2}.[0-9]{1,2})', 'PHP');
-
- $ros[] = array('MS FrontPage', 'Windows');
- $ros[] = array('(msproxy)/([0-9]{1,2}.[0-9]{1,2})', 'Windows');
- $ros[] = array('(msie)([0-9]{1,2}.[0-9]{1,2})', 'Windows');
- $ros[] = array('libwww-perl', 'Unix');
- $ros[] = array('UP.Browser', 'Windows CE');
- $ros[] = array('NetAnts', 'Windows');
-
- $file = count ( $ros );
- $os = '';
-
- for ( $n=0 ; $n<$file ; $n++ ){
- if ( eregi ( $ros[$n][0] , $agent, $name ) ){
- $os = @$ros[$n][1].' '.@$name[2];
- break;
- }
- }
-
- return trim ( $os );
- }
/* return Operating System */
function operating_system_detection(){
if ( isset( $_SERVER ) ) {
$agent = $_SERVER['HTTP_USER_AGENT'] ;
}
else {
global $HTTP_SERVER_VARS ;
if ( isset( $HTTP_SERVER_VARS ) ) {
$agent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ;
}
else {
global $HTTP_USER_AGENT ;
$agent = $HTTP_USER_AGENT ;
}
}
$ros[] = array('Windows XP', 'Windows XP');
$ros[] = array('Windows NT 5.1|Windows NT5.1)', 'Windows XP');
$ros[] = array('Windows 2000', 'Windows 2000');
$ros[] = array('Windows NT 5.0', 'Windows 2000');
$ros[] = array('Windows NT 4.0|WinNT4.0', 'Windows NT');
$ros[] = array('Windows NT 5.2', 'Windows Server 2003');
$ros[] = array('Windows NT 6.0', 'Windows Vista');
$ros[] = array('Windows CE', 'Windows CE');
$ros[] = array('(media center pc).([0-9]{1,2}\.[0-9]{1,2})', 'Windows Media Center');
$ros[] = array('(win)([0-9]{1,2}\.[0-9x]{1,2})', 'Windows');
$ros[] = array('(win)([0-9]{2})', 'Windows');
$ros[] = array('(windows)([0-9x]{2})', 'Windows');
// Doesn't seem like these are necessary...not totally sure though..
//$ros[] = array('(winnt)([0-9]{1,2}\.[0-9]{1,2}){0,1}', 'Windows NT');
//$ros[] = array('(windows nt)(([0-9]{1,2}\.[0-9]{1,2}){0,1})', 'Windows NT'); // fix by bg
$ros[] = array('Windows ME', 'Windows ME');
$ros[] = array('Win 9x 4.90', 'Windows ME');
$ros[] = array('Windows 98|Win98', 'Windows 98');
$ros[] = array('Windows 95', 'Windows 95');
$ros[] = array('(windows)([0-9]{1,2}\.[0-9]{1,2})', 'Windows');
$ros[] = array('win32', 'Windows');
$ros[] = array('(java)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})', 'Java');
$ros[] = array('(Solaris)([0-9]{1,2}\.[0-9x]{1,2}){0,1}', 'Solaris');
$ros[] = array('dos x86', 'DOS');
$ros[] = array('unix', 'Unix');
$ros[] = array('Mac OS X', 'Mac OS X');
$ros[] = array('Mac_PowerPC', 'Macintosh PowerPC');
$ros[] = array('(mac|Macintosh)', 'Mac OS');
$ros[] = array('(sunos)([0-9]{1,2}\.[0-9]{1,2}){0,1}', 'SunOS');
$ros[] = array('(beos)([0-9]{1,2}\.[0-9]{1,2}){0,1}', 'BeOS');
$ros[] = array('(risc os)([0-9]{1,2}\.[0-9]{1,2})', 'RISC OS');
$ros[] = array('os/2', 'OS/2');
$ros[] = array('freebsd', 'FreeBSD');
$ros[] = array('openbsd', 'OpenBSD');
$ros[] = array('netbsd', 'NetBSD');
$ros[] = array('irix', 'IRIX');
$ros[] = array('plan9', 'Plan9');
$ros[] = array('osf', 'OSF');
$ros[] = array('aix', 'AIX');
$ros[] = array('GNU Hurd', 'GNU Hurd');
$ros[] = array('(fedora)', 'Linux - Fedora');
$ros[] = array('(kubuntu)', 'Linux - Kubuntu');
$ros[] = array('(ubuntu)', 'Linux - Ubuntu');
$ros[] = array('(debian)', 'Linux - Debian');
$ros[] = array('(CentOS)', 'Linux - CentOS');
$ros[] = array('(Mandriva).([0-9]{1,3}(\.[0-9]{1,3})?(\.[0-9]{1,3})?)', 'Linux - Mandriva');
$ros[] = array('(SUSE).([0-9]{1,3}(\.[0-9]{1,3})?(\.[0-9]{1,3})?)', 'Linux - SUSE');
$ros[] = array('(Dropline)', 'Linux - Slackware (Dropline GNOME)');
$ros[] = array('(ASPLinux)', 'Linux - ASPLinux');
$ros[] = array('(Red Hat)', 'Linux - Red Hat');
// Loads of Linux machines will be detected as unix.
// Actually, all of the linux machines I've checked have the 'X11' in the User Agent.
//$ros[] = array('X11', 'Unix');
$ros[] = array('(linux)', 'Linux');
$ros[] = array('(amigaos)([0-9]{1,2}\.[0-9]{1,2})', 'AmigaOS');
$ros[] = array('amiga-aweb', 'AmigaOS');
$ros[] = array('amiga', 'Amiga');
$ros[] = array('AvantGo', 'PalmOS');
//$ros[] = array('(Linux)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}(rel\.[0-9]{1,2}){0,1}-([0-9]{1,2}) i([0-9]{1})86){1}', 'Linux');
//$ros[] = array('(Linux)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}(rel\.[0-9]{1,2}){0,1} i([0-9]{1}86)){1}', 'Linux');
//$ros[] = array('(Linux)([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3}(rel\.[0-9]{1,2}){0,1})', 'Linux');
$ros[] = array('[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3})', 'Linux');
$ros[] = array('(webtv)/([0-9]{1,2}\.[0-9]{1,2})', 'WebTV');
$ros[] = array('Dreamcast', 'Dreamcast OS');
$ros[] = array('GetRight', 'Windows');
$ros[] = array('go!zilla', 'Windows');
$ros[] = array('gozilla', 'Windows');
$ros[] = array('gulliver', 'Windows');
$ros[] = array('ia archiver', 'Windows');
$ros[] = array('NetPositive', 'Windows');
$ros[] = array('mass downloader', 'Windows');
$ros[] = array('microsoft', 'Windows');
$ros[] = array('offline explorer', 'Windows');
$ros[] = array('teleport', 'Windows');
$ros[] = array('web downloader', 'Windows');
$ros[] = array('webcapture', 'Windows');
$ros[] = array('webcollage', 'Windows');
$ros[] = array('webcopier', 'Windows');
$ros[] = array('webstripper', 'Windows');
$ros[] = array('webzip', 'Windows');
$ros[] = array('wget', 'Windows');
$ros[] = array('Java', 'Unknown');
$ros[] = array('flashget', 'Windows');
// delete next line if the script show not the right OS
//$ros[] = array('(PHP)/([0-9]{1,2}.[0-9]{1,2})', 'PHP');
$ros[] = array('MS FrontPage', 'Windows');
$ros[] = array('(msproxy)/([0-9]{1,2}.[0-9]{1,2})', 'Windows');
$ros[] = array('(msie)([0-9]{1,2}.[0-9]{1,2})', 'Windows');
$ros[] = array('libwww-perl', 'Unix');
$ros[] = array('UP.Browser', 'Windows CE');
$ros[] = array('NetAnts', 'Windows');
$file = count ( $ros );
$os = '';
for ( $n=0 ; $n<$file ; $n++ ){
if ( eregi ( $ros[$n][0] , $agent, $name ) ){
$os = @$ros[$n][1].' '.@$name[2];
break;
}
}
return trim ( $os );
}
Conclusion
bonne lecture
Sources du même auteur
Sources de la même categorie
SONDAGE - VOTE - POLL (AVEC MYSQL)SONDAGE - VOTE - POLL (AVEC MYSQL) Vous souhaitez inclure un sondage en ligne sur votre site. Certes, l'interface admin n'est pas de toute beauté mais ça fonctionne ;-)
- Gestion/sto...
par hornet_bzz
LISTENGEN GÉNÉRATEUR DE FICHIER PLAYLISTLISTENGEN GÉNÉRATEUR DE FICHIER PLAYLISTLisTenGEN
Générateur de fichier playlist pour webradio
Extension compatible : .pls, .m3u, .m3u8, .ram, .qtl, asx, wax, wpl....
par AGG
IP CALCULATORIP CALCULATOR Cette classe est la version PHP du programme unix ipcalc. Il permet de calculer à partir d'une adresse IP (en binaire, hexadécimal ou au format xxx.xx...
par X_Cli
WHOIS DOMAIN CLASS : LOOKUP & AVAIBILITYWHOIS DOMAIN CLASS : LOOKUP & AVAIBILITYCe script vous permettra de lancer une requette whois. Le whois vous renseigne les informations d'un nom de domaine, et éventuellement vous indique si...
par aKheNathOn
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
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
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
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
vider le contenu d'un fichier [ par Clonk ]
Bonjour,Ne pouvant pas utiliser de BDD, je dois me contenter d'un fichier texte pour mes référencements, le problème est que, si j'arrive à écrire et
Get et un systeme de navig [ par zakaria74 ]
Bonjour, Aidez-moi SVP car je suis un débutant, j'ai un fichier un site : www.monsite.com Le menu de mon site se presente comme suit : Accueil = index
Probleme variable FORM [ par Clonk ]
bonjour,voilà mon 'petit' probleme:j'ai un formulaire de modification, je recupere les infos d'un fichier texte et puor certaines infos, il se peut qu
Télécharger un CSV et en Extraire les Infos [ par jdaviaud ]
Ben voila mon problème, je cherche à faire un script qui dialogue avec E-gold.com pour ceux qui connaissent.A un moment il me propose donc de téléchar
|
Derniers Blogs
[MIX10] KEYNOTE DEUXIèME JOURNéE - INTERNET EXPLORER 9, HTML5, VISUAL STUDIO 2010, ODATA[MIX10] KEYNOTE DEUXIèME JOURNéE - INTERNET EXPLORER 9, HTML5, VISUAL STUDIO 2010, ODATA par cyril
Le deuxième keynote du mix fut très riche en contenu. Internet Explorer 9 Juste un après le lancement de Internet Explorer 8, Microsoft a dévoilé les nouveautés de Internet Explorer 9. Désormais, IE supportera HTML5, SVG et CSS3. L'élément ...
Cliquez pour lire la suite de l'article par cyril CERTIFICATIONS BETA .NET 4CERTIFICATIONS BETA .NET 4 par KooKiz
Les inscriptions pour les certifications beta .NET 4 ont commencé. L'inscription est offerte pour les examens suivants : - 71-511, TS: Windows Applications Development with Microsoft .NET Framework 4 - 71-515, TS: Web Applications Development with...
Cliquez pour lire la suite de l'article par KooKiz [MIX 2010] - MICROSOFT TRANSLATOR TECHNOLOGY PREVIEW V2[MIX 2010] - MICROSOFT TRANSLATOR TECHNOLOGY PREVIEW V2 par redo
J'imagine que la plupart d'entre vous connaissent bien et utilisent le service de traduction de Google, mais connaissez-vous celui de Microsoft . Microsoft Translator ? Effectivement, Microsoft nous annoncé le lancement version 2 de la Technologie Preview...
Cliquez pour lire la suite de l'article par redo LANCEMENT EN PREVIEW DE CYCLONE LORS DES TECHDAYS 2010!LANCEMENT EN PREVIEW DE CYCLONE LORS DES TECHDAYS 2010! par MPOWARE
Toutes les vidéos de ce lancement sont en ligne!
Partie I - Intro
http://www.youtube.com/watch?v=LkQzTQ8T6CA
Partie II - Démo 1
http://www.youtube.com/watch?v=drAhYQ7lqvo
Partie III - Démo 2
http://www.youtube.com/watch?v=c8KM_1Gqybc...
Cliquez pour lire la suite de l'article par MPOWARE
Forum
RE : PHP ALGORE : PHP ALGO par Arto_8000
Cliquez pour lire la suite par Arto_8000
Logiciels
Academy System (10.9.4.0)ACADEMY SYSTEM (10.9.4.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Xilisoft Convertisseur Vidéo Ultimate (5.1.39.0305)XILISOFT CONVERTISSEUR VIDéO ULTIMATE (5.1.39.0305)Xilisoft Convertisseur Vidéo Ultimate est un outil puissant de conversion vidéo, facile à utilise... Cliquez pour télécharger Xilisoft Convertisseur Vidéo Ultimate Xilisoft DVD Ripper Ultimate (5.0.64.0304)XILISOFT DVD RIPPER ULTIMATE (5.0.64.0304)Xilisoft DVD Ripper Ultimate est un logiciel excellent pour copier et convertir DVD vers presque ... Cliquez pour télécharger Xilisoft DVD Ripper Ultimate Rigs of Rods (63.3)RIGS OF RODS (63.3)c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo... Cliquez pour télécharger Rigs of Rods
|