Codice:
<?php
$image_info = array(
'image' => 'personal.gif'
);
//we obtain what we need (otteniamo ciò che ci serve)
$curos=strtolower($_SERVER['HTTP_USER_AGENT']);
//we obtain user ip (otteniamo l'ip dell'utente
$uip=$_SERVER['REMOTE_ADDR'];
//we obtain user ISP (otteniamo l'isp dell'utente
$uht=gethostbyaddr($_SERVER['REMOTE_ADDR']);
//definiamo l'os dell'utente
if (ereg("mac", $curos)) {
$uos="MacOS";
} else if (ereg("linux", $curos)) {
$uos="Linux";
} else if (ereg("windows", $curos)) {
if (ereg("windows nt 5.1", $curos)) {
$uos="Windows Xp";
} else if (ereg("windows nt 5.0", $curos)) {
$uos="Windows 2000";
} else if (ereg("windows nt 4.9", $curos)) {
$uos="Windows 98";
} else {
$uos="windows";
}
} else if (ereg("bsd", $curos)) {
$uos="BSD";
} else if (ereg("qnx", $curos)) {
$uos="QNX";
} else if (ereg("sun", $curos)) {
$uos="SunOS";
} else if (ereg("solaris", $curos)) {
$uos="Solaris";
} else if (ereg("irix", $curos)) {
$uos="IRIX";
} else if (ereg("aix", $curos)) {
$uos="AIX";
} else if (ereg("unix", $curos)) {
$uos="Unix";
} else if (ereg("amiga", $curos)) {
$uos="Amiga";
} else if (ereg("os/2", $curos)) {
$uos="OS/2";
} else if (ereg("beos", $curos)) {
$uos="BeOS";
} else { $uos="Non riconosciuto";
}
//definiamo il browser dell'utente
if (ereg("gecko",$curos)) {
if (ereg("safari", $curos)) {
$bos="Safari";
} else if (ereg("camino", $curos)) {
$bos="Camino";
} else if (ereg("firefox", $curos)) {
$bos="Firefox";
} else if (ereg("netscape", $curos)) {
$bos="Netscape";
} else { $bos="Mozilla";
}
} else if (ereg("opera", $curos)) {
$bos="Opera";
} else if (ereg("msie", $curos)) {
if (ereg("msie 6", $curos)) {
$bos="Internet Explorer 6";
} else if (ereg("msie 5", $curos)) {
$bos="Internet Explorer 5";
} else {
$bos="Internet Explorer";
}
} else if (ereg("voyager", $curos)) {
$bos="Voyager";
} else if (ereg("lynx", $curos)) {
$bos="Lynx";
}elseif(ereg("webtv", $curos)) {
$bos="WebTV";
}elseif(ereg("Konqueror", $curos)){
$bos="Konqueror";
} else { $bos="Non riconosciuto";
}
$image_text = array(
array(
'x' => 8,
'y' => 6,
'color' => array(50, 100, 180),
'font' => -5,
'text' => $uip
),
array(
'x' => 8,
'y' => 22,
'color' => array(50, 100, 180),
'font' => -5,
'text' => $uos
),
array(
'x' => 22,
'y' => 6,
'color' => array(50, 100, 180),
'font' => -5,
'text' => $bos
),
array(
'x' => 22,
'y' => 22,
'color' => array(50, 100, 180),
'font' => -5,
'text' => $uht
)
);
include('./includes/dynamic_gd_image.php');
?>