hi, my site will have been around for about a year in a few weeks, and its gone through alot of changes. it use to be just html but i've been learning PHP and i've added a few features using it. i've added a news system for the admins to post, and commenting system for users to comment on news and videos, and a few other things.
But now to the problem i'm having. I'm trying to add a page for my video editors to easily upload there videos to the /videos directory, from a page on the site. I'm still kind of new, but i've been looking searching through the forums and this is what i've come up with so far:
//here is code from ftp.php (its a .php because i'll be adding more code to it so only admins can access it..)//
<form action="ftp2.php" method="post" enctype="multipart/form-data">
<br><br>
Choose a file to upload:<br>
<input type="file" name="file"><br>
file name once on server.. don't forget to include the extension. such as .avi or .wmv<br>
<input type="text" name="name"><br>
<input type="submit" name="submit" value="submit">
</form>
//and here is ftp2.php//
<?php
// set up the settings
$ftp_server = '***';
$ftpuser = '***';
$ftppass = '***';
$source_file = $HTTP_POST_VARS['file'];
$destination_file = '/test/'$HTTP_POST_VARS['name'];
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftpuser, $ftppass);
//upload the file
$upload = ftp_put($conn_id, “$destination_file”, “$source_file”, FTP_BINARY); // the ftp function
//check upload status
if (!$upload) {
echo "Upload Failed!";
} else {
echo "Uploaded $source_file to $ftp_server as $destination_file";
// close the connection
ftp_close($conn_id);
?>
After i submitt a file, it goes to ftp2.php and display just a white page. I know its probly pretty obvious to one of you whats wrong, but its the best i've got.
thanks in advanced for any help