Get Browser function Getbrowse () {Global $_server; $Agent = $_server[' http_user_agent '); $browseinfo = "; if (Ereg (' Mozilla ', $Agent) &&!ereg (' MSIE ', $Agent)) {$browseinfo = ' Netscape Navigator '; } if (Ereg (' opera ', $Agent)) {$browseinfo = ' opera '; } if (Ereg (' Mozilla ', $Agent) && ereg (' MSIE ', $Agent)) {$browseinfo = ' Internet Explorer '; } if (Ereg (' Chrome ', $Agent)) {$browseinfo = "chrome"; } if (Ereg (' Safari ', $Agent)) {$browseinfo = "safari"; } if (Ereg (' Firefox ', $Agent)) {$browseinfo = "Firefox"; } return $browseinfo;} Get Ipfunction GetIP () {Global $_server; if (getenv (' http_client_ip ')) {$ip = getenv (' http_client_ip '); } else if (getenv (' http_x_forwarded_for ')) {$ip = getenv (' http_x_forwarded_for '); } else if (getenv (' remote_addr ')) {$ip = getenv (' remote_addr '); } else {$ip = $_server[' remote_addr '); } return $IP;} Gets the user system function Getos () {Global $_server; $agent = $_server[' http_user_agent '); $os = false; if (' Win ', $agent) && strpos ($agent, ' eregi ') {$os = ' Windows 95 '; }elseif (Eregi (' Win 9x ', $agent) && strpos ($agent, ' 4.90 ')) {$os = ' Windows ME '; }elseif (eregi (' win ', $agent) && ereg (' 98 ', $agent)) {$os = ' Windows 98 '; }elseif (eregi (' win ', $agent) && eregi (' NT 5.1 ', $agent)) {$os = ' Windows XP '; }elseif (eregi (' win ', $agent) && eregi (' NT 5.2 ', $agent)) {$os = ' Windows 2003 '; }elseif (eregi (' win ', $agent) && eregi (' NT 5 ', $agent)) {$os = ' Windows 2000 '; }elseif (eregi (' win ', $agent) && eregi (' NT ', $agent)) {$os = ' Windows nt '; }elseif (eregi (' win ', $agent) && ereg (' + ', $agent)) {$os = ' Windows 32 '; }elseif (eregi (' Linux ', $agent)) {$os = ' Linux '; }elseif (eregi (' Unix ', $agent)) {$os = ' Unix '; }elseif (Eregi (' Sun ', $agent) && Eregi (' OS ', $agent)) {$os = ' SunOS '; }elseif (eregi (' IBM ', $agent) && eregi (' OS ', $agent)) {$os = ' IBM OS/2 '; }elseif (eregi (' Mac ', $agent) && eregi (' PC ', $agent)) {$os = ' Macintosh '; }elseif (eregi (' PowerPC ', $agent)) {$os = ' PowerPC '; }elseif (eregi (' Aix ', $agent)) {$os = ' Aix '; }elseif (eregi (' HPUX ', $agent)) {$os = ' HPUX '; }elseif (eregi (' NetBSD ', $agent)) {$os = ' NetBSD '; }elseif (eregi (' BSD ', $agent)) {$os = ' BSD '; }elseif (Ereg (' OSF1 ', $agent)) {$os = ' OSF1 '; }elseif (Ereg (' IRIX ', $agent)) {$os = ' IRIX '; }elseif (eregi (' FreeBSD ', $agent)) {$os = ' FreeBSD '; }elseif (eregi (' teleport ', $agent)) {$os = ' teleport '; }elseif (eregi (' FlashGet ', $agent)) {$os = ' flashget '; }elseif (eregi (' Webzip ', $agent)) {$os = ' webzip '; }elseif (eregi (' Offline ', $agent)) {$os = ' offline '; }else{$os = ' Unknown '; } return $os;}
PHP $_server[' http_user_agent ']