slydog Posted February 25, 2007 Share Posted February 25, 2007 Hello all, Does anyone know how or is its even possible to do the following. 1. "Dynamic IP Address" 2. Linksys Router reporting to dyndns.com IP Address changes dyndns keeps track of it. Would like to know if it’s possible and if so, do you know where I can receive the code to do the following. 1. Display different icons for if the connection is live or dead. The part that I’m having trouble with is that the IP always changes so the echo would have to be the URL. Any suggestions would be super great. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/39993-any-sugestions/ Share on other sites More sharing options...
BrandonE97 Posted February 25, 2007 Share Posted February 25, 2007 I use to run on my Dlink router an update to no-IP.com because of my dynamic IP. On the other part of your question Im a bit unsure on how you would do that since your connection has to be up for any pages to show. Thats if your running a home server. Otherwise if you just want people to know that your online at home and have your pages on a server somewhere else that is possible. Link to comment https://forums.phpfreaks.com/topic/39993-any-sugestions/#findComment-193410 Share on other sites More sharing options...
slydog Posted February 25, 2007 Author Share Posted February 25, 2007 hum let me better explain this.. This may help.. Like your D-Link I'm able to have dyndns get and display the proper data It knows the IP address even as it changes and displays it on there page. What I would like to do in a way is "ping that url" if the url responds then a page would show a given icon If the ping times out then show a different icon. Like a "server status light" on/off but a "URL Live light" on/off because i know that if that URL responds then the connection there is still live. If no response then the icon would change I know your thinking just log into dyndns and check.. Well I have 259 of these DSL lines and it would be much better to look at one page and spot the dead one. Link to comment https://forums.phpfreaks.com/topic/39993-any-sugestions/#findComment-193420 Share on other sites More sharing options...
BrandonE97 Posted February 25, 2007 Share Posted February 25, 2007 You could try and modify this: $command = "ping 127.0.0.1 -c 1"; system($command,$value); and have the IP's in place of 127.0.0.1. The output is a bit much though. Link to comment https://forums.phpfreaks.com/topic/39993-any-sugestions/#findComment-193428 Share on other sites More sharing options...
slydog Posted February 25, 2007 Author Share Posted February 25, 2007 BrandonE97, Thanks for that slap of code... I had to modify a couple parts but it was just a change from command to echo.. But then again i don't know what $command stand for.. Although i have seen it in game programming.... What you have provided gives alot of information on a given url and it accepts not only a IP but it will take the URL and tell you what the IP is. Its nice. Here is the one that I used masking domains.... <?php $echo = "ping sub_doamin.domain_name.com -c 1"; system($echo,$value); ?> Now I could use it and when the page is loaded that displays all the DSL's it of course is going to start the ping process that would show a time out if one was dead. Humm.. Brandon Thank You for getting me on that track...... Although what Brandon provided being excellent does anyone have the answer in there back pocket like Brandon did, on how to attach an image to the results? Link to comment https://forums.phpfreaks.com/topic/39993-any-sugestions/#findComment-193442 Share on other sites More sharing options...
BrandonE97 Posted February 26, 2007 Share Posted February 26, 2007 Hey Slydog, I found some code on php.net and made a couple mods to it and maybe you can use this too. <?php $address = "IP.Addr.Goes.Here"; $command = "ping -c 1 ".$address; $r = exec($command); if ($r[0]=="r") { $image = "online_image.jpg"; } else { $image = "offline_image.jpg"; } ?> Link to comment https://forums.phpfreaks.com/topic/39993-any-sugestions/#findComment-194801 Share on other sites More sharing options...
liquinas Posted February 26, 2007 Share Posted February 26, 2007 I used to run a server on a dynamic IP, I used http://www.changeip.com I had my registrar point to chaneip's servers, and you they give you a small system tray client. It updates fast, and you can keep track of everything. It was only like $7 a year, I've had more expensive sandwiches, so it was a good service. You might like it, you might not, just letting you know as a customer I was pretty satisfied. Link to comment https://forums.phpfreaks.com/topic/39993-any-sugestions/#findComment-194805 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.