...

View Full Version : How to detect IP



nolvorite
07-12-2007, 03:59 PM
Umm I need help detecting someone's IP adress:
This is my code


<?php
if (getenv("HTTP_X_FORWARDED_FOR"))
$ip = getenv("HTTP_X_FORWARDED_FOR");
else $ip = getenv("REMOTE_ADDR");
?>

Please help me

ess
07-12-2007, 04:06 PM
The code you provided above should do it. Unless you are looking to find the geo location of website visitors. If that is the case, check this url

http://www.phpclasses.org/browse/package/1477.html

Cheers,
Ess



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum