The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I've probably asked about this before on my geeky travels, but I've come back to it again, as I want to use it for a Uni project.
My question is quite simple: How do I upload using PHP? And, can it be done on FREEOLA's servers?
I've had a quick go at it, but it didn't work. I think I'm confused about the connection ID/ftp_server thingies:
$ftp_server=" ";
$ftp_user_name=" ";
$ftp_user_pass=" ";
$source_file=stripslashes("$file_to_upload");
$destination_file=" ";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if((!$conn_id) || (!$login_result))
{
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
}
else
{
echo "Connected to $ftp_server, for user $ftp_user_name";
}
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
if(!$upload)
{
echo "FTP upload has failed!";
}
else
{
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
ftp_close($conn_id);
?>
Can anyone shed any light on this please? Thanks in advance.
I've probably asked about this before on my geeky travels, but I've come back to it again, as I want to use it for a Uni project.
My question is quite simple: How do I upload using PHP? And, can it be done on FREEOLA's servers?
I've had a quick go at it, but it didn't work. I think I'm confused about the connection ID/ftp_server thingies:
$ftp_server=" ";
$ftp_user_name=" ";
$ftp_user_pass=" ";
$source_file=stripslashes("$file_to_upload");
$destination_file=" ";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if((!$conn_id) || (!$login_result))
{
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
exit;
}
else
{
echo "Connected to $ftp_server, for user $ftp_user_name";
}
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
if(!$upload)
{
echo "FTP upload has failed!";
}
else
{
echo "Uploaded $source_file to $ftp_server as $destination_file";
}
ftp_close($conn_id);
?>
Can anyone shed any light on this please? Thanks in advance.