Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.


If you are using PHP server side programming and wondering how to track the IP addresses of the web site visitors, this is a useful PHP Function, which would display the IP address of your web site visitor.
To start with, you need to check your environment variable and make the changes (if required)
No Proxy detection
=> REMOTE_ADDR – Remote client IP address
With Proxy detection
=> HTTP_X_FORWARDED_FOR – Get Proxy server IP
PHP getenv() function
=> Use php getenv() function to read the value of the environment.
This piece of code can be added on your web site or blog to let your visitors know about their IP address :
<
What is my IP address?
if (getenv(HTTP_X_FORWARDED_FOR)) {
$pipaddress = getenv(HTTP_X_FORWARDED_FOR);
$ipaddress = getenv(REMOTE_ADDR);
echo "Your Proxy IPaddress is : ".$pipaddress. "(via $ipaddress)" ;
} else {
$ipaddress = getenv(REMOTE_ADDR);
echo "Your IP address is : $ipaddress";
}
?>
This small but useful piece of code will enable your web site or blog visitors to get to know their IP address. This feature will surely impress a lot of your web site followers.
This piece of script will be prove to be a useful tool to your web site visitors, as people need to know their IP address to play games or share connections.
Place the code within the
and of your html document.If your server pages include xhtml extension, then this code has to be slightly altered. But it works perfectly on html extension. So, as per the set up of your server, you have to re-modify it retaining its soul.
This is the most viable method to track the IP addresses of your web site visitors. This tutorial will enable the web site owner to know the IP address and physical location (like, country) of his web site visitor.
Google offers you a free a way to track the information of your web site visitors. Below is the procedure which is worth trying:
Step 1:
You can sign up for free Google API Key. You can easily load the Google AJAX API script on your web site. This enables Google to record the web site visitors’ information in google.loader.ClientLocation.
<script type="text/javascript" src="http://www.google.com/jsapikey=API_KEY_GOES_HERE">script>
Step 2:
You have to add this script inside its own
Rajkiran SwainPosted Jun 19, 2017, 5:52 AM
Put it in single quotes
Rajkiran SwainPosted Jun 19, 2017, 6:39 AM
Ijas HameemPosted Jun 19, 2017, 6:23 AM
Rajkiran SwainPosted Jun 19, 2017, 6:05 AM