• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Help a newbie playing with php/scripting

What I want to accomplish is to always know my house's IP Address and be able to access it over the internet from wherever i may be. I'm on DSL so it's a dynamically assigned IP. I have a place I can host online. Basically I want my computer at home to constantly load a php document on my web-host that grabs the IP and writes it to an html file that i can load up remotely and see what it is at any given moment. something like just leave a firefox window up to a page:
-----------------------
<meta reload=10 minutes>
$ip=@$REMOTE_ADDR;

write to "myip.html"
-------------------
then i can load myip.html and i should be good to go.
questions: I've never coded PHP but it doesn't look terribly difficult, and lots of documentation online. is there a more elegant solution to this? is there a script or a command line that i can pass to firefox to load the page, then close the window?
 
if you did want to do it via php, you could do this.

<?php
echo "<html><head><meta http-equiv=refresh content=5></head>"
$ip = $_SERVER['REMOTE_ADDR'];
echo "<body>My IP: $ip </body></html>";
?>

then just set your browser to point to that php page.

But seriously, I'd just use DynDNS.
 
Just a thought, but wouldn't you need to know the IP to get to the PHP page?

I'm assuming their isn't a router in between, since it would be easier just to set an preferred IP on the router for the box in question. And without a router, there is no port forwarding to the machine's local IP.
 
I believe he was talking about a server that calls the php page. So he could check that known server to get the ip of the machine he wants (which is calling that page over and over again).

I just realized my script just echo's back your ip. I forgot to do the write to file part LOL.

Still dynDNS solves this problem a lot more elegantly.
 
Back
Top