From the discussion in the other part of this thread, unless I am mistaken, it looks like you are still trying to broadcast your IP address using a web site instead of dynamic DNS. Did you ever get dyndns working? I believe that it provides the easiest, simplest solution for the problem.
Otherwise, have a look at this QBASIC 1.1 code. It gets your current IP address from checkip.dyndns.com, and uploads it to a web host using Windows's built in command line FTP program. Obviously, you will need to substitute your own host name, user name, and password. But, it works, as you can see from:
This works in QBASIC 1.1. It would seem that you could do something similar from QB64 without needing to SHELL to external programs.
Then, it is a simple matter for the client to get it from there, and do whatever it is that needs to be done.
As I've said, the command line FTP utility that comes with Windows does not support passive FTP. It will have to use active FTP. Windows Firewall will pop up asking you if you want to allow it. Active FTP represents a slight security issue as far as you firewall is concerned, because it means allowing incoming connections to any high numbered port.
'note: overwrites "ip.htm", "ip.txt", and "script.txt" in the current folder
'public domain, may 2011, michael calkins
DIM t AS STRING
'get current ip address. If we are connected directly to the internet, with
'no NAT, you could parse redirected output from ipconfig. However, if you are
'behind a NAT router/gateway, we can use checkip.dyndns instead:
SHELL "del ip.htm"
SHELL "\calkins\wget http://checkip.dyndns.com/ -O ip.htm"
OPEN "ip.htm" FOR INPUT AS 1
LINE INPUT #1, t
t = MID$(t, INSTR(t, ":") + 2)
t = LEFT$(t, INSTR(t, "<") - 1)
OPEN "ip.txt" FOR OUTPUT AS 1
PRINT #1, t;
'qbasic makes the filename uppercase, but i want it to be lowercase.
SHELL "cmd /C rename ip.txt ip.txt"
'generate an ftp script file
OPEN "script.txt" FOR OUTPUT AS 1
PRINT #1, "QBASICMI@qbasicmichael.com" ' username
PRINT #1, "oh, but wouldn't you like know? ;-)" 'password
PRINT #1, "cd www" 'folder
PRINT #1, "binary"
PRINT #1, "put ip.txt"
PRINT #1, "close"
PRINT #1, "quit"
'use -s:filename instead of redirecting input
SHELL "ftp -s:script.txt ftp.qbasicmichael.com"
Return to Index
|Response Title||Author and Date|
|passive version||on May 29|
|Why is /calkins/ in there?||on May 29|
|because||on May 29|
|What is the correct location?||on May 29|
|do you have wget?||on May 30|
|* Yep, I needed it! Thank you! :-)||on May 30|