Jump to content

IP address comes from?


eduard

Recommended Posts

Yes - the way you access it depends on what language you are using. With PHP, for example, you can use the $_SERVER['REMOTE_ADDR'] index.

Link to comment
Share on other sites

I have a website. Can I see, where the IP addresses which visited my website come from?
If you bought a web space to publish your site (if it is not a free web space), normally you have a statistics utility that let you check the number of visits to your web site. The statistic contains a lot of details including the IP address of the visitors.Perhaps you can ask your web space supplier how you can access the statistics file.regardsgabriele
Link to comment
Share on other sites

Yes - the way you access it depends on what language you are using. With PHP, for example, you can use the $_SERVER['REMOTE_ADDR'] index.
This will return some valid IPs, but if they're using a proxy or other forwarding mechanism you may want to go with something like this:
// try and get the real IP address...if (getenv('HTTP_CLIENT_IP')) {	$ip_address = getenv('HTTP_CLIENT_IP');}elseif (getenv('HTTP_X_FORWARDED_FOR')) {	$ip_address = getenv('HTTP_X_FORWARDED_FOR');}elseif (getenv('HTTP_X_FORWARDED')) {	$ip_address = getenv('HTTP_X_FORWARDED');}elseif (getenv('HTTP_FORWARDED_FOR')) {	$ip_address = getenv('HTTP_FORWARDED_FOR');}elseif (getenv('HTTP_FORWARDED')) {	$ip_address = getenv('HTTP_FORWARDED');}else {	$ip_address = $_SERVER['REMOTE_ADDR'];}

Link to comment
Share on other sites

Heh - well, it all depends on what IP you're trying to get, exactly. Also, proxies don't have to send those headers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...