jmr3460 Posted November 10, 2009 Share Posted November 10, 2009 Is there some function that can be sent to a ddns service that returns the ip address of a ddns forward. I am working on a script that uses a dvr from a home and the owner wants to have the dvr stream to his website. Only thing the ISP changes his IP address ever so often. I was looking for a way to find out automatically if the home ip has been changed. Can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/ Share on other sites More sharing options...
PugJr Posted November 10, 2009 Share Posted November 10, 2009 $ip = $_SERVER['REMOTE_ADDR']; ? Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954506 Share on other sites More sharing options...
jmr3460 Posted November 10, 2009 Author Share Posted November 10, 2009 So if I do a script that goes to this ddns domain that forwards to this guys IP address this script will give me the forwarded ip and not the ddns ip address? PHP is a server side scripting language and for this to work (I think) this script would have to be on the server that I need the ip from. Right? How do I make the script bounce back? from a machine that does not have PHP on it at all? Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954557 Share on other sites More sharing options...
joel24 Posted November 10, 2009 Share Posted November 10, 2009 $_SERVER['REMOTE_ADDR']; gets the clients IP address from the interaction between the server and the client. i.e. if you had a page <?php echo $_SERVER['REMOTE_ADDR']; ?> it would echo the IP of the person viewing the page. Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954560 Share on other sites More sharing options...
Philip Posted November 10, 2009 Share Posted November 10, 2009 If you're gathering from his DVR, the easiest way would be to to use a dynamic dns service. Since its from a stand alone DVR (and most likely not a PC), a cron job & using a pinging script on his side to your server with a password to gather the ip would probably be out of the question. Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954562 Share on other sites More sharing options...
jmr3460 Posted November 10, 2009 Author Share Posted November 10, 2009 I don't know about out of the question but this guy does not know much about these machines and I would have to teach him what to do. I have a script already that when opened with a user and password inserts takes the ip and inserts into a db if it is different than what is already their. Only thing is he was wanting something that is automatic. Maybe I could do something that would send him an email with a link that would run on a cron job every other day or so with a link just as a reminder. I was really hoping for something that would get the new address that way. I really don't need his dvr ip just his IPS IP. Will windows run something that could open that script? Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954582 Share on other sites More sharing options...
Philip Posted November 10, 2009 Share Posted November 10, 2009 You could have him install WAMP on there, and run it in the background. But, if he turns off his computer, or kills the process - then you're outta luck. Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954585 Share on other sites More sharing options...
jmr3460 Posted November 10, 2009 Author Share Posted November 10, 2009 I think I will talk to him about that. I will have to look into setting up a cron job on WAMP. Thanks for all the time you spent with me. Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954594 Share on other sites More sharing options...
jmr3460 Posted November 10, 2009 Author Share Posted November 10, 2009 It appears that Windows has a scheduler that can be setup to open a browser to a specific address. I think that if I set up a schedule that opens browser with an address to the script with some value in it for $_GET. Would there be any security risk to his machine in any way? Or is there a way to setup a self submitting login form? Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954608 Share on other sites More sharing options...
Dorky Posted November 10, 2009 Share Posted November 10, 2009 they already have this http://www.slingmedia.com/ Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-954616 Share on other sites More sharing options...
jmr3460 Posted November 10, 2009 Author Share Posted November 10, 2009 Is there some kind of software on that site that will send my ip address to a server somewhere every time my ip changes? It looks like some kind of sales site for the Sling. Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-955272 Share on other sites More sharing options...
joel24 Posted November 11, 2009 Share Posted November 11, 2009 are you familiar with any computer programming languages? it would be pretty easy to write a script which when the IP changes it loads a page on the server which takes the ip address.. visual studio has built in browser windows etc for its forms, so you could have a tiny application with a built in browser and each time the IP address changes (check say every 60seconds?) then it will tell the browser to go to that page... and it can have a built in authorisation code incase bots etc access it and the ip gets changed i.e. www.yourserver.com/php/updateIP.php?authCode=a4jsdncx8234jklsdj2343k52nKLJSDFAH3b if (isset($_GET['authCode']) == 'a4jsdncx8234jklsdj2343k52nKLJSDFAH3b') { $ip = $_SERVER['REMOTE_ADDR']; $sql = @mysql_query("UPDATE ipAddress SET ip = '$ip'"); } Quote Link to comment https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/#findComment-955313 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.