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.
$new_file_name = "filename.jpg";
$file_a = "$form_image_a";
$remote_file = "$new_file_name";
$ftp_host = "hostname";
$conn_id = ftp_connect($ftp_host);
$ftp_user_name = "username";
$ftp_user_pass = "password";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if(ftp_put($conn_id, $remote_file, $file_a, FTP_BINARY))
{ print("Successfully uploaded $file_a \n"); }
else
{ print("There was a problem while uploading $file_a \n"); }
ftp_close($conn_id);
?>
What's wrong with that? Please.
$new_file_name = "filename.jpg";
$file_a = "$form_image_a";
$remote_file = "$new_file_name";
$ftp_host = "hostname";
$conn_id = ftp_connect($ftp_host);
$ftp_user_name = "username";
$ftp_user_pass = "password";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if(ftp_put($conn_id, $remote_file, $file_a, FTP_BINARY))
{ print("Successfully uploaded $file_a \n"); }
else
{ print("There was a problem while uploading $file_a \n"); }
ftp_close($conn_id);
?>
What's wrong with that? Please.
But shouldn't there be a ';' after:
if(ftp_put($conn_id, $remote_file, $file_a, FTP_BINARY))';'< There?
Probably not but my knowledge of PHP is poor.
Edit:
Oh..
Also wouldnt you have to specify the size of the file that you wish to upload?
Because the script is trying to act like a client.
> My knowledge of PHP is very limited.
> But shouldn't there be a ';' after:
> if(ftp_put($conn_id, $remote_file, $file_a, FTP_BINARY))';'<
> There?
Not in this case, as an if statement is being used. If you look on the next line, you'll see he's opening up the block with the {.