I am trying to make a video upload and playback website and the code I have so far isn’t working.
[php]<?php
mysql_connect(“localhost”,“root”,"");
mysql_select_db(“video_system”);
if(isset($_POST[‘submit’]))
{
$name = isset($_FILES['file']) ? $_FILES['name'] : '' ;
$temp = isset($_FILES['file']) ? $_FILES['tmp_name'] : '' ;
move_uploaded_file($temp,"Video_Uploads/".$name);
$url = "http://localhost/PHP/video%20upload%20and%20playback/video_uploads/$name";
mysql_query("INSERT INTO `videos` VALUE ('','$name','$url')");
}
?>[/php]
And
[php]<?php
if(isset($_POST['submit']))
{
echo "<br>".$name. " has been submitted";
}
?>[/php]
It only echoes " has been uploaded" and not the $name. Urls do appear in the database but I don’t know if it is working the way it should. Heres the tutorial I followed so far -> https://www.youtube.com/watch?v=MpRRckA2Bo8