Jump to content

Archived

This topic is now archived and is closed to further replies.

anup09

Php Write CHMOD 777 Remotely

Recommended Posts

i want to know how to write files from 1 server to another..

say i had a stats script on 1 server that logs to a file called log.txt on the same server as the script.. what if i wanted the script to log onto the other server in a folder chmodded 777.. is that possible.. how can i do it ??..


Share this post


Link to post
Share on other sites
I suppose you could ftp in with something like:
[code]
<?php
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if ((!$conn_id) || (!$login_result)) {
      echo "Could not connect to the FTP server";
      exit;
  }
$upload = ftp_put($conn_id, 'log.txt', 'log.txt', FTP_BINARY);

if (!$upload) {
      echo "Could not upload to the FTP server";
  }
ftp_close($conn_id);
?>
[/code]

Is that what you had in mind?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.