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 ??.. Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.