Im trying to get the script to validate the "trailer" field and see if the movie trailer uploaded is in the quicktime .mov format. If it isn't, i want $ok = "no" and $reply = $reply."<br> - Please make sure that your trailer is in the Quicktime .mov format.<br>";

The script isnt working even when i upload a .mov file, it says that it isn't the right file format.

I tried doing a test of
PHP Code:
echo $_FILES['trailer']['type']; 
but it didnt do anything.

Anyone help?



PHP Code:
<?
include("header.php"); 
$reply = "Please fill out the form below to add a new movie to the site.<br>";

if(isset($_POST['submit'])){
    $pass = $_POST['pass'];
    $access = "123";
    $ok = "yes";
    
    if($pass != $access){
        $ok = "no";
        $reply = $reply."<br> - The password you entered is incorrect. Please enter the correct password to continue<br>";
    } else {
        $title = $_POST['title'];
        $title_nospace = str_replace(" ", "_", $title);
        $year = $_POST['year'];
        $syn = $_POST['syn'];
        $poster = $_FILES['poster']['name'];
        $trailer = $_FILES['trailer']['name'];
        $screen1 = $_FILES['screen1']['name'];
        $screen2 = $_FILES['screen2']['name'];
        $screen3 = $_FILES['screen3']['name'];
        $screen4 = $_FILES['screen4']['name'];
        $quicktime = "video/quicktime";
        $trailer_type = $_FILES['trailer']['type'];
        
        if(empty($title)){
            $ok = "no";
            $reply = $reply."<br> - Please enter the title of the movie.<br>";
        }
        if(empty($year)){
            $ok = "no";
            $reply = $reply."<br> - Please enter the year the movie was released.<br>";
        }
        if(!($trailer_type == $quicktime)){
            $ok = "no";
            $reply = $reply."<br> - Please make sure that your trailer is in the Quicktime .mov format.<br>";
        } else {
            $reply = "Your trailer file format is correct!";
        }

    }
    
    if($ok == "yes"){
        $reply = "<b>Your movie information has been added successfully!</b>";
    }
}
?>