Many times we have received the private mails requesting the help to track the IP address of the users. Here is a simple php code to get the IP address of the user. With a little addition to the code, you can get the location details of the user like Country, State and city. Please see the code below.
Now to show the IP use
<?php echo getIP();?>
How to get the location details from IP?
To get the location details like city, state, country, latitude, longitude etc.. from IP address of user, use the following code along with the above.
Thats it. If you have some alternate ways for getting these details, please post it below.Tags: convert ip to city, convert ip to location, easy ip location, find ip address, get user ip, how to locate ip, ip to country, ip to state, location from ip address, php ip detection, track user ip