Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 19, 2017, 1:35 AM EDT
0
For PHP Users :
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"; } ?>
For JAVA Script Users
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.
Using the Google AJAX API script
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.
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 19, 2017, 1:52 AM EDT
Put it in single quotes
getenv('HTTP_X_FORWARDED_FOR')Sundaram SubramanianRank #150 · 15.2K reputationPosted Jun 19, 2017, 12:53 AM EDT
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 19, 2017, 1:35 AM EDT
For PHP Users :
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 :
For JAVA Script Users
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.
Using the Google AJAX API script
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.
Step 2:
You have to add this script inside its own