Not sure if this can be done with PHP or if its another language. Would like to know how to retrieve this information Private & Public IP So it can show it on a website. Is this possible with PHP?
Hello, Do you mean get the IP of a visitor? That can be done with: $ip = $_SERVER['REMOTE_ADDR']; PHP: or do you mean get the IP of a server or something else? Sky22
Yes, the IP of the visitor I can find how to get the IP but not there IP if behind a router. So need a way to fetch both IPs edit*** those are getting the private IP not the public IP
It's impossible to retrieve the private (networked IP), as the router controls packets as it crosses it and all requests from any router will contain only the public (ISP) IP address.
The HTTP header http://en.wikipedia.org/wiki/X-Forwarded-For might be of some use but other than that I don't think it can be done unless you have access to the router. Sky22
Would something to this effect do it? Doesnt work for me but might have a space or something that is out of place. Actually disregard this I will ask the owner of the script if he will share the asp code he used. Hoped it could be in php