A more accurate IP To detect proxys ... function getRealIP() { if ($_SERVER ['HTTP_X_FORWARDED_FOR'] != '') { $client_ip = (! empty ( $_SERVER ['REMOTE_ADDR'] )) ? $_SERVER ['REMOTE_ADDR'] : ((! empty ( $_ENV ['REMOTE_ADDR'] )) ? $_ENV ['REMOTE_ADDR'] : "unknown"); // Proxies are added at the end of this header // Ip addresses that are "hiding". To locate the actual IP // User begins to look for the beginning to find // Ip address range that is not private. If not // Found none is taken as the value REMOTE_ADDR $entries = split ( '[, ]', $_SERVER ['HTTP_X_FORWARDED_FOR'] ); reset ( $entries ); while ( list ( , $entry ) = each ( $entries ) ) { $entry = trim ( $entry ); if (preg_match ( "/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $entry, $ip_list )) { // http://www.faqs.org/rfcs/rfc1918.html $private_ip = array ('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/', '/^10\..*/' ); $found_ip = preg_replace ( $private_ip, $client_ip, $ip_list [1] ); if ($client_ip != $found_ip) { $client_ip = $found_ip; break; } } } } else { $client_ip = (! empty ( $_SERVER ['REMOTE_ADDR'] )) ? $_SERVER ['REMOTE_ADDR'] : ((! empty ( $_ENV ['REMOTE_ADDR'] )) ? $_ENV ['REMOTE_ADDR'] : "unknown"); } return $client_ip; } Code (markup): and of course, to show the ip: <?php echo "IP: ".getRealIP(); ?> Code (markup):
i use "get_browser()" download that, add a few lines to ur php.ini file and your good to go http://us2.php.net/function.get-browser
no it doesn't it shows browser related info, sorry for the confusion, here's a print_r on get_browser: Array ( [browser_name_regex] => ^mozilla/5\.0 (macintosh; .*; .*mac os x.*; .*; rv:1\.9.*) gecko/.* firefox/3\.0.*$ [browser_name_pattern] => Mozilla/5.0 (Macintosh; *; *Mac OS X*; *; rv:1.9*) Gecko/* Firefox/3.0* [parent] => Firefox 3.0 [platform] => MacOSX [browser] => Firefox [version] => 3.0 [majorver] => 3 [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [javaapplets] => 1 [javascript] => 1 [cssversion] => 2 [supportscss] => 1 [minorver] => 0 [alpha] => [beta] => [win16] => [win32] => [win64] => [backgroundsounds] => [cdf] => [vbscript] => [activexcontrols] => [isbanned] => [ismobiledevice] => [issyndicationreader] => [crawler] => [aol] => [aolversion] => 0 ) PHP: