Class client{
Public Function __construct ()
{
/**/
}
/**
* Get Browser client
*
* @return String
*/
Public Function Browser ()
{
$info = $_server[' http_user_agent '];
if (Strstr ($info, ' MSIE 6.0 ')!= false) {
Return ' IE6 ';
}elseif (Strstr ($info, ' MSIE 7.0 ')!= false) {
Return ' IE7 ';
}elseif (Strstr ($info, ' Firefox ')!= false) {
Return ' Firefox ';
}elseif (Strstr ($info, ' Chrome ')!= false) {
Return ' Chrome ';
}elseif (Strstr ($info, ' Safari ')!= false) {
Return ' Safari ';
}else{
Return ' Unknow ';
}
}
/**
* Get the operating system
* @return String
*/
Public Function Getos ()
{
$agent = $_server[' http_user_agent '];
$os = false;
if (eregi (' win ', $agent) && strpos ($agent, ' 95 ')) {
$os = ' Windows 95 ';
}
else if (eregi (' Win 9x ', $agent) && strpos ($agent, ' 4.90 ')) {
$os = ' Windows ME ';
}
else if (eregi (' win ', $agent) && ereg (' $agent) ') {
$os = ' Windows 98 ';
}
else if (eregi (' win ', $agent) && eregi (' NT 5.1 ', $agent)) {
$os = ' Windows XP ';
}
else if (eregi (' win ', $agent) && eregi (' NT 5 ', $agent)) {
$os = ' Windows 2000 ';
}
else if (eregi (' win ', $agent) && eregi (' NT ', $agent)) {
$os = ' Windows NT ';
}
else if (eregi (' win ', $agent) && ereg (' A ', $agent)) {
$os = ' Windows 32 ';
}
else if (eregi (' Linux ', $agent)) {
$os = ' Linux ';
}
else if (eregi (' Unix ', $agent)) {
$os = ' Unix ';
}
else if (eregi (' Sun ', $agent) && eregi (' OS ', $agent)) {
$os = ' SunOS ';
}
else if (eregi (' IBM ', $agent) && eregi (' OS ', $agent)) {
$os = ' IBM os/2 ';
}
else if (eregi (' Mac ', $agent) && eregi (' PC ', $agent)) {
$os = ' Macintosh ';
}
else if (eregi (' PowerPC ', $agent)) {
$os = ' PowerPC ';
}
else if (eregi (' AIX ', $agent)) {
$os = ' AIX ';
}
else if (eregi (' HPUX ', $agent)) {
$os = ' HPUX ';
}
else if (eregi (' NetBSD ', $agent)) {
$os = ' NetBSD ';
}
else if (eregi (' BSD ', $agent)) {
$os = ' BSD ';
}
else if (ereg (' OSF1 ', $agent)) {
$os = ' OSF1 ';
}
else if (ereg (' IRIX ', $agent)) {
$os = ' IRIX ';
}
else if (eregi (' FreeBSD ', $agent)) {
$os = ' FreeBSD ';
}
else if (eregi (' teleport ', $agent)) {
$os = ' teleport ';
}
else if (eregi (' FlashGet ', $agent)) {
$os = ' FlashGet ';
}
else if (eregi (' Webzip ', $agent)) {
$os = ' Webzip ';
}
else if (eregi (' Offline ', $agent)) {
$os = ' offline ';
}
else {
$os = ' Unknown ';
}
return $os;
}
/**
* Get IP Address
* @return String
*/
Public Function GetIP ()
{
if (getenv ("Http_client_ip") && strcasecmp (getenv ("Http_client_ip"), "Unknown")) {
$ip = getenv ("Http_client_ip");
}elseif (getenv ("Http_x_forwarded_for") && strcasecmp (getenv ("Http_x_forwarded_for"), "Unknown")) {
$ip = getenv ("Http_x_forwarded_for");
}elseif (getenv ("REMOTE_ADDR") && strcasecmp (getenv ("REMOTE_ADDR"), "Unknown")) {
$ip = getenv ("REMOTE_ADDR");
}elseif (Isset ($_server[' remote_addr ']) && $_server[' remote_addr '] && strcasecmp ($_server[' Remote_ ADDR '], "unknown") {
$ip = $_server[' remote_addr '];
}else{
$ip = "Unknown";
}
return ($IP);
}
}