DETERMINER LE SYSTÈME D'EXPLOITATION D'UN VISITEUR

Neozix Messages postés 33 Date d'inscription mercredi 27 février 2002 Statut Membre Dernière intervention 25 avril 2003 - 21 août 2003 à 19:29
webdeb Messages postés 488 Date d'inscription samedi 5 avril 2003 Statut Membre Dernière intervention 31 mars 2009 - 9 avril 2007 à 23:59
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/13380-determiner-le-systeme-d-exploitation-d-un-visiteur

webdeb Messages postés 488 Date d'inscription samedi 5 avril 2003 Statut Membre Dernière intervention 31 mars 2009 4
9 avril 2007 à 23:59
regarde le chapitre des tableaux sur la doc officielle : http://fr.php.net/arrays
cs_miata Messages postés 86 Date d'inscription mardi 31 août 2004 Statut Membre Dernière intervention 19 août 2008
9 avril 2007 à 23:17
Surement, ce n'est pas la premiere fois que l'on me le suggère ...
Mais comment on fait au fait ?
webdeb Messages postés 488 Date d'inscription samedi 5 avril 2003 Statut Membre Dernière intervention 31 mars 2009 4
9 avril 2007 à 22:39
En plaçant les valeurs possibles dans un tableau ce serait quand même plus intelligent non ?
cs_miata Messages postés 86 Date d'inscription mardi 31 août 2004 Statut Membre Dernière intervention 19 août 2008
29 déc. 2006 à 13:38
if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows NT 5.2")) {echo "Windows Server 2003";}
if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows NT 6.0")) {echo "Windows Vista";}
peoplehard Messages postés 26 Date d'inscription samedi 26 avril 2003 Statut Membre Dernière intervention 26 novembre 2008
11 févr. 2004 à 15:55
Ou aussi:

if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows NT 5.1")) {
echo "Windows XP";
}else{
if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows NT 5.0")) {
echo "Windows 2000";
if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows 98")) {
echo "Windows 98";
}else{
if (strstr($_SERVER["HTTP_USER_AGENT"], "Windows 95")) {
echo "Windows 95";
}else{
if (strstr($_SERVER["HTTP_USER_AGENT"], "Linux")) {
echo "Linux";
}else{
if (strstr($_SERVER["HTTP_USER_AGENT"], "Unix")) {
echo "Unix";
}else{
if (strstr($_SERVER["HTTP_USER_AGENT"], "FreeBSD")) {
echo "FreeBSD";
}else{
if (strstr($_SERVER["HTTP_USER_AGENT"], "Mac")) {
echo "Macintosh";
}else{
if (strstr($_SERVER["HTTP_USER_AGENT"], "Apple")) {
echo "Apple";
}
}
}
}
}
}
}
}
}
Neozix Messages postés 33 Date d'inscription mercredi 27 février 2002 Statut Membre Dernière intervention 25 avril 2003
21 août 2003 à 19:29
cool merci. et heu vive LinuX !!!