views:

64

answers:

1

Hi, I was wondering - is it possible to change files that are stored on some sort of webhosting service via PHP? I mean I have a URL say: "plist.atwebpages.com/action.php" will it possible for this method to write a file onto the ftp server on the web hosting service? e.g. http://www.batcave.net

A: 

Yes - you need a PHP FTP client library.

RichieHindle
But is it possible to implement this on a webhosting service? could you please elaborate, as I am not really familiar with PHP and such.Thank you.
natanavra
By using an FTP client library, your PHP code can access any FTP server in the just the same way that you can access it yourself using your FTP client.
RichieHindle
If you can't set up a cron task to do the FTP, use a web page script which is called externally every once in a while...
razzed
That is, of course, given the fact that you have the username/password for that server on which the file resides on.
GiladG
Could you refer me somewhere, as from what I understand so far it is possible even on a webhosting service if it has FTP server, all I need is the PHP code that can manipulate files according to received data. Am I correct?Please give me a few links or write here.Thanks.
natanavra
Download the FTP client library I pointed you to. In there is sample PHP code (upload.php / upload.html) showing how to use that library to write a file to a remote FTP server.
RichieHindle
Thank you very much, I will look into it as soon as I can!
natanavra