Jump to content

Is there a function ... auto send IP


jmr3460

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/180929-is-there-a-function-auto-send-ip/
Share on other sites

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?

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.

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?

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?

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'");
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.