Sometimes you are working in the development and you have to do something like that. If we have any request or a user’s request is coming, then. This request is coming from which IP address is coming from us.
It is very easy to get the IP address of any user’s system in javascript or jquery. Javascript or Jquery code has been written below. And it has also been explained.
You can also get the ip address of any user’s system through php, laravel framework or other framework code.
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>How to Get Client Ip Address Using JavaScript?</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> var ipinfo; $.getJSON("https://ipinfo.io", function (data) { $("#details").html("City: " + data.city + " ,County: " + data.country + " ,IP: " + data.ip + " ,Location: " + data.loc + " ,Organisation: " + data.org + " ,Postal Code: " + data.postal + " ,Region: " + data.region + "") }) </script> </head> <body> <p>Client's Details:</p> <p id="details"></p> </body> </html>