I'm interested in finding the visitors ip similar to how www.ipchicken.com does it, can someone nice out there tell me how to do this and send me a simple code?
Asked
Active
Viewed 134 times
-4
-
1It's not HTML, it's done server-side. You can do that with any server-side language. – Jakub Matczak May 23 '16 at 10:20
-
3Step 1: Pick a server side programming language supported by your server. Step 2: Find the inevitable duplicate question on SO. e.g. [this](http://stackoverflow.com/questions/4489078/how-do-find-ip-address-of-client-using-perl) or [this](http://stackoverflow.com/questions/16575722/how-to-get-a-viewers-ip-address-with-python) or [this](http://stackoverflow.com/questions/8107856/how-to-determine-a-users-ip-address-in-node) or [this](http://stackoverflow.com/questions/11683246/get-ip-address-of-client-in-jsp) – Quentin May 23 '16 at 10:20
-
3Possible duplicate of [How to detect the visitor's IP address using HTML?](http://stackoverflow.com/questions/8687642/how-to-detect-the-visitors-ip-address-using-html) – Ankur Bhadania May 23 '16 at 10:21
-
You can't do it through HTML.However you can find the IP address of a visitor through PHP using $ip=$_SERVER['REMOTE_ADDR']; – Ankur Bhadania May 23 '16 at 10:22
1 Answers
0
You will have to use a third party API service like this IPIFY
Make an AJAX call to this API and you will get the IP in the response.
$.ajax({
url: "https://api.ipify.org?format=json"
type: "GET",
success: function (data) {
alert("IP: " + data);
}
});

kvn
- 2,210
- 5
- 20
- 47
-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/12443524) – Jonathan Argentiero May 23 '16 at 10:51
-