Limit file type upload video : <p>how do I add that only mp4 is accepted?</p>

<pre><code>&lt;?php
if(isset($_POST['submit']))
{
    $name = $_FILES['file']['name'];
    $temp = $_FILES['file']['tmp_name'];

    move_uploaded_file($temp,"uploaded/".$name);
    $url = "/uploaded/$name";

    $db-&gt;query("INSERT INTO `videos` VALUES ('','$name','$url')");

    $query = $db-&gt;query("SELECT * FROM videos WHERE name = '".$name."'");
    $row = $query-&gt;fetch_assoc();
    echo "&lt;center&gt;Your upload is created &lt;a href='watch.php?id=".$row['id']. "' target='blank_'&gt;CLICK&lt;/a&gt;&lt;/center&gt;";
}
?&gt;
</code></pre>

<p>Can you repost the php with right php script</p>
