anup09 Posted October 26, 2006 Share Posted October 26, 2006 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 ??.. Link to comment https://forums.phpfreaks.com/topic/25119-php-write-chmod-777-remotely/ Share on other sites More sharing options...
ksteuber Posted October 28, 2006 Share Posted October 28, 2006 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? Link to comment https://forums.phpfreaks.com/topic/25119-php-write-chmod-777-remotely/#findComment-115708 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.