Jump to content

IP address comes from?


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 post
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 post
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'];}

Edited by End User
Link to post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...