I have just re-done my code to see if it works but I can use Dark Basic because the time ran out and its a demo. Can someone please run the code while connected to the net. You only have to type a name and wait for 5 seconds. It will create a file on the net. You will be listed in my credits of the program that I am doing. Please post a message here when you have run the program. Thank you.
'***************************
'** Messenger **
'***************************
'get username (no password either in this example)
INPUT "Please enter a username: "; userName$
'---------------
'connect to ftp server using the info of the ftp site you have.
FTP CONNECT "paradise-workshop.netfirms.com", "paradise-workshop", "yvcbz"
FTP SET DIR "www"
'---------------
'get the DATABASE.txt to copy onto the hard drive
'temporarily.
FTP GET FILE "DATABASE.txt", "DATABASE.txt"
'---------------
'open the file that is now on the hard drive.
OPEN TO READ 1, "DATABASE.txt"
'---------------
'put the usernames in the dim array by reading from the file.
READ STRING 1, name1$
IF FILE END(1)=1 THEN GOTO endReadLoop
READ STRING 1, name2$
IF FILE END(1)=1 THEN GOTO endReadLoop
READ STRING 1, name3$
IF FILE END(1)=1 THEN GOTO endReadLoop
READ STRING 1, name4$
IF FILE END(1)=1 THEN GOTO endReadLoop
READ STRING 1, name5$
endReadLoop:
CLOSE FILE 1
DELETE FILE "DATABASE.txt"
amountOfUsers=index
'---------------
'open file to write the usernames plus your own.
OPEN TO WRITE 1, "DATABASE.txt"
WRITE STRING 1, name1$
WRITE STRING 1, name2$
WRITE STRING 1, userName$
CLOSE FILE 1
'---------------
'put the updated file on the ftp site
FTP PUT FILE "DATABASE.txt"
'delete the file from your hardrive as it is not needed and will creat errors if kept.
DELETE FILE "DATABASE.txt"
'---------------
'print done and disconnect
FTP DISCONNECT
PRINT "DONE"
PRINT "Press escape"
xxxpetratxxx
B. R. W