Jujo Posted May 1, 2009 Posted May 1, 2009 (edited) Today I made a simple program that updates IP address using AutoIt and PHP. PHP keeps track of IPs, and AutoIt submits it. Note: You need hosting account with PHP support Heres AutoIt code: #Include <Constants.au3> #Include <IE.au3> #NoTrayIcon HotKeySet("{ESC}", "die") HotKeySet("{^F5}", "refresh") $wait = InputBox("Updater", "Waiting time: ", "21600", "", "", "", "", "", 10) $port = InputBox("Updater", "Port to submit: ", "1004", "", "", "", "", "", 10) If $wait = 0 Or $wait = "" Then $wait = 21600 EndIf If $port = 0 Or $port = "" Then $port = 1004 EndIf $wait = $wait * 1000 refresh() While 1 Sleep($wait) refresh() WEnd Func refresh() $object = _IECreate("URL/update.php?port=" & $port, 0, 1) _IEQuit($object) EndFunc Func die() Exit EndFunc You have to change URL to some URL where is your update.php script located. Here is update.php script source: <? $myFile = "data.txt"; $fh = fopen($myFile, 'w') or die("ERROR FILE 1"); $stringData = $_SERVER['REMOTE_ADDR'].':'.$_GET['port']; fwrite($fh, $stringData); fclose($fh); ?> And, for reading, you just need to load data.txt file in your browser. Save this PHP file as update.php and create empty file called data.txt I also recommend you to password protect the whole folder, but thats your choise Edited May 1, 2009 by Jujo
avery Posted May 9, 2009 Posted May 9, 2009 Today I made a simple program that updates IP address using AutoIt and PHP. PHP keeps track of IPs, and AutoIt submits it. Note: You need hosting account with PHP support Heres AutoIt code: #Include <Constants.au3> #Include <IE.au3> #NoTrayIcon HotKeySet("{ESC}", "die") HotKeySet("{^F5}", "refresh") $wait = InputBox("Updater", "Waiting time: ", "21600", "", "", "", "", "", 10) $port = InputBox("Updater", "Port to submit: ", "1004", "", "", "", "", "", 10) If $wait = 0 Or $wait = "" Then $wait = 21600 EndIf If $port = 0 Or $port = "" Then $port = 1004 EndIf $wait = $wait * 1000 refresh() While 1 Sleep($wait) refresh() WEnd Func refresh() $object = _IECreate("URL/update.php?port=" & $port, 0, 1) _IEQuit($object) EndFunc Func die() Exit EndFunc You have to change URL to some URL where is your update.php script located. Here is update.php script source: <? $myFile = "data.txt"; $fh = fopen($myFile, 'w') or die("ERROR FILE 1"); $stringData = $_SERVER['REMOTE_ADDR'].':'.$_GET['port']; fwrite($fh, $stringData); fclose($fh); ?> And, for reading, you just need to load data.txt file in your browser. Save this PHP file as update.php and create empty file called data.txt I also recommend you to password protect the whole folder, but thats your choise Can I use this with DynDNS? I always wanted to have that updated for me www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now