Tutoriel : Php | Catégorie : Scripts | Ecrit par Webmaster le 29

Transcription

Tutoriel : Php | Catégorie : Scripts | Ecrit par Webmaster le 29
Tutoriel : Php | Catégorie : Scripts | Ecrit par Webmaster le 29/06/2009 à 12:03:48
Lien url : http://webdezign.tutoriaux.free.fr/Tutoriaux.php?categorie=Php&Souscategorie=Scripts&page=39
Toute reproduction totale ou partielle de ce fichier est interdit ! © 2017 Webdezign.tutoriaux.free.fr Tous droits réservés
Php : Connaître le système d'exploitation d'un client
Voici un petit script qui permet d'afficher le nom du système d'exploitation de vos clients :
<?php
// Conna&icirc;tre le système d'exploitation du client
if (ereg("Win", getenv("HTTP_USER_AGENT")))
$os = "Windows";
elseif ((ereg("Mac", getenv("HTTP_USER_AGENT"))) || (ereg("PPC", getenv("HTTP_USER_AGENT"))))
$os = "Mac";
elseif (ereg("Linux", getenv("HTTP_USER_AGENT")))
$os = "Linux";
elseif (ereg("FreeBSD", getenv("HTTP_USER_AGENT")))
$os = "FreeBSD";
elseif (ereg("SunOS", getenv("HTTP_USER_AGENT")))
$os = "SunOS";
elseif (ereg("IRIX", getenv("HTTP_USER_AGENT")))
$os = "IRIX";
elseif (ereg("BeOS", getenv("HTTP_USER_AGENT")))
$os = "BeOS";
elseif (ereg("OS/2", getenv("HTTP_USER_AGENT")))
$os = "OS/2";
elseif (ereg("AIX", getenv("HTTP_USER_AGENT")))
$os = "AIX";
else
$os = "Autre";
//Affiche le système d'exploitation du client
echo $os;
?>
Page 1

Documents pareils