I’m currently trying to create a ftp uploader for the company website, so we can recieve artwork from clients, however it isn’t working can anyone look at the script and see where its going wrong. I’ve looked at loads of tutorials but it still wont work.
#simple test
<?php
$ftp_user_name ='';
$ftp_user_pass ='';
$ftp_server='';
// open some file for reading
$file = 'somefile.txt';
$fp = fopen($file, 'r');
// set up basic connection
$conn_id = ftp_connect($ftp_server)
or die ("Ftp server connection failed:);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass)
or die ("user / password not correct");
// try to upload $file
if (ftp_fput($conn_id, $file, $fp, FTP_ASCII)) {
echo "Successfully uploaded $file
";
} else {
echo "There was a problem while uploading $file
";
}
// close the connection and the file handler
ftp_close($conn_id);
fclose($fp);
?>
well i can’t them to work, i’m not really what i’m doing to get them to work, how do i implement them to html form code i have? sorry i’m new to php and don’t get to use it often.