when using the form, if I leave the video field empty, everything else (title, desc, keywords) is posted to database table. BUT, if I enter a video file along with all the other information, nothing uploads at all. the form takes the title, description, keywords, runtime (length), and file (which would be avideo).
//This is the directory where videos will be saved
$target = "media/videos/";
$target = $target . basename( $_FILES['video']['name']);
//This gets all the other information from the form
$title=$_POST['title'];
$description=$_POST['description'];
$runtime=$_POST['runtime'];
$keywords=$_POST['keywords'];
$video=($_FILES['video']['name']);
// Connects to your Database
include_once ("../include/connect_to_mysql.php");
//Writes the information to the database
//ad all the details to database
$query = "INSERT INTO videos (dateAdded, title, runtime, description, video, keywords) VALUES (now(), '$title', '$runtime', '$description', '$video', '$keywords')";
$results=mysql_query($query);
//Writes the video to the server
if(move_uploaded_file($_FILES['video']… $target))
{
//Tells you if its all ok
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
}
else {
//Gives and error if its not
echo "Sorry, there was a problem uploading your file.";
}