使用PHP上传视频

时间:2018-05-06 16:00:55

标签: javascript php file upload video-streaming

我尝试使用此代码上传视频。

但是下面的代码对我不起作用,有人可以帮忙吗?

如果需要,请更正代码。 我不熟悉PHP ..

<?php
mysql_connect("localhost","root","123456789");
mysql_select_db("vid");

if(isset($_POST['submit']))
{
        $name = $_FILES['file']['name'];
        $name = $_FILES['file']['temp_name'];

        move_uploaded_file($temp,"uploaded/".$name);
        $url = "http://localhost/video/uploaded/$name";
        mysql_query("INSERT INTO `videos` VALUE ('','$name','$url') ");
}

?>





<body>
<a href="videos.php">Videos</a>
<form action="upload.php" method="POST" enctype="multipart/form-data">

<input type="file" name="file" />
<br><br>
<input type="submit" name="submit" value="Upload" />
</form>
<?php
if(isset($_POST['submit']))
{
        echo "<br/>".$name." has been Uploaded";
}

?>


</body>

感谢

0 个答案:

没有答案