Inloggen
if(!isset($_POST["submit"])){?>
}
else
{
set_time_limit(300);//for uploading big files
$paths=$_POST['user'];
$filep=$_FILES['userfile']['tmp_name'];
$ftp_server="86.87.141.147";
$ftp_user_name=$_POST['user'];
$ftp_user_pass=$_POST['password'];
$name=$_FILES['userfile']['name'];
// set up a connection to ftp server
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
echo "
";
echo "Verbinding maken met FTP-server van Energy Engineering voor $ftp_user_name ....";
// check connection and login result
if ((!$conn_id) || (!$login_result)) {
echo "
";
echo "Er is een fout opgetreden met de FTP-verbinding!";
echo "
";
echo "Verbinding is mislukt ....";
echo "
";
exit;
} else {
echo "
";
echo "$ftp_user_name verbonden met FTP-server van Energy Engineering .....";
}
echo "
";
echo "
";
echo "$name wordt gekopieerd naar de FTP-server van Energy Engineering ....";
// upload the file to the path specified
$upload = ftp_put($conn_id, $paths.'/'.$name, $filep, FTP_BINARY);
// check the upload status
if (!$upload) {
echo "
";
echo "
";
echo "Er is een fout opgetreden bij het kopiƫren !";
} else {
echo "
";
echo "Het bestand gekopieerd !";
}
// close the FTP connection
ftp_close($conn_id);
}
?>