radstorm Posted December 28, 2008 Share Posted December 28, 2008 Hi all, is there a script that can announce your ip address? What I mean is a script in the desktop server that would send the updated ip address to perhaps my hosted website, so users will know where to go next time. Or perhaps email them all? This is because I do not have a static ip address. Quote Link to comment https://forums.phpfreaks.com/topic/138618-a-scrpit-to-announce-ip-address/ Share on other sites More sharing options...
Lamez Posted December 28, 2008 Share Posted December 28, 2008 <?php $ip = $_SERVER['REMOTE_ADDR']; echo $ip; ?> you should post in the php help section for more.. Quote Link to comment https://forums.phpfreaks.com/topic/138618-a-scrpit-to-announce-ip-address/#findComment-724808 Share on other sites More sharing options...
zq29 Posted December 28, 2008 Share Posted December 28, 2008 You should look into services such as www.dyndns.org Quote Link to comment https://forums.phpfreaks.com/topic/138618-a-scrpit-to-announce-ip-address/#findComment-724827 Share on other sites More sharing options...
The Little Guy Posted December 30, 2008 Share Posted December 30, 2008 I was thinking of doing something similar, and this is what I would do: buy a domain name, then create an index file that would grab the location from a database (if I used an IP) and use a header redirect to send them to the IP address. On the host computer, I would then create a script that checked its IP address every 5 minutes or so, and if it has changed update the server, then update a file on the computer saying its current IP address. Now, you won't have to connect to a database every 5 minutes, you just would read in a value from the local machine. and if it is different from the current IP then you connect to the database update it with the new value and update the local file with the new value. Quote Link to comment https://forums.phpfreaks.com/topic/138618-a-scrpit-to-announce-ip-address/#findComment-725951 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.