Re: How do I get my own IP address?
- Posted by CoJaBo Sep 21, 2009
- 2535 views
To get your external ip address which the rest of the world sees, set up a short php script on a remote http host to return the contacting ip (that would be you) when you http to it. Keep in mind your isp may change that out from under you at any time, and your router - switch - modem - hub may block all contacts which originate from the outside world.
If it's your External IP address (i.e. that your router, cable modem, etc...) may have, you can use get_url() on http://www.whatismyip.com/ and do a bit of text parsing. A bit more work each time than what Kat is suggesting, but you don't have to have an external server running (not sure of your resources).
Jeremy
Why do text parsing? They have an API: http://www.whatismyip.com/automation/n09230945.asp