ronnie88 Posted July 3, 2008 Share Posted July 3, 2008 Hi I am attempting to write a script that opens up a .dat or a text file and adds a few lines on a remote server that I know the password and username on. Can anyone help me get started? Thanks a bunch if there is a code already out there can you please forward it on here thanks again. Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/ Share on other sites More sharing options...
DyslexicDog Posted July 3, 2008 Share Posted July 3, 2008 You say you know the user name and password of the server, what kind of server is it? Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/#findComment-580784 Share on other sites More sharing options...
ronnie88 Posted July 3, 2008 Author Share Posted July 3, 2008 it would be a windows I'm going to attempt to create a anti-hack streaming website sorta like pbbans.com to add bans in a text file or a .dat file. Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/#findComment-580791 Share on other sites More sharing options...
TransmogriBenno Posted July 3, 2008 Share Posted July 3, 2008 How are you connecting to the remote server: FTP, SMB, NFS, ...? Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/#findComment-580814 Share on other sites More sharing options...
ronnie88 Posted July 3, 2008 Author Share Posted July 3, 2008 ftp Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/#findComment-580822 Share on other sites More sharing options...
TransmogriBenno Posted July 3, 2008 Share Posted July 3, 2008 I assume that file wrappers work for FTP connections. You could try using a file wrapper with fopen in append mode. If that doesn't work, you could download the file, use string concatenation to append the new lines, and then upload the new version. That could get problematic if there are several copies of your script hitting the server at once. Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/#findComment-580831 Share on other sites More sharing options...
DyslexicDog Posted July 3, 2008 Share Posted July 3, 2008 If you're connecting to a ftp server you will need to download the file from the server then upload it back to the server after you've made the changes necessary. Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/#findComment-580859 Share on other sites More sharing options...
ronnie88 Posted July 3, 2008 Author Share Posted July 3, 2008 well I was trying so they enter there ip and username password in an SSH website encrypted of course and all they had to do was press a button to download the ban list. is there an easier way of doing it? Link to comment https://forums.phpfreaks.com/topic/113072-how-to-open-a-text-file-and-add-lines-on-a-remote-server/#findComment-580883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.