I am new to PHP and part of my uni project requires me to, send a time and date stamp enquiry result file to a remote server folder. Is it as easy as adding the URL to my code. Thanks for any help.
Hi gareth,
Yes, you can upload files to a remote server using PHP provided that you have FTP access to that server. Here’s how you would basically do it:
[php]
$connection = ftp_connect($server);
$login = ftp_login($connection, $ftp_user_name, $ftp_user_pass);
if (!$connection || !$login) { die(‘Connection attempt failed!’); }
$upload = ftp_put($connection, $dest, $source, $mode);
if (!$upload) { echo ‘FTP upload failed!’; }
else{ echo “Success”;}
ftp_close($connection); [/php]
Cheers