<?php
mysql_connect("localhost","-","-");
mysql_select_db("-");
if(isset($_POST['submit']))
{
$name = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];
move_uploaded_file($temp,"uploaded/".$name);
$url = "/uploaded/$name";
mysql_query("INSERT INTO `videos` VALUES ('','$name','$url')");
}
?>
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>www.test.nl</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="container">
<div class="header">
<h1>www.test.nl</h1>
</div><br/>
<div class="content">
<center><h2>Upload Your Video</h2><br/>
<form action="index.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" /><br/><br/>
<input type="submit" name="submit" value="Upload!" /><br/><br/>
</form></center>
<?php
if(isset($_POST['submit']))
{
$query = mysql_query("SELECT * FROM `videos`");
while($row = mysql_fetch_assoc($query))
{
$id = $row['id'];
$name = $row['name'];
}
echo "Your upload is created <a href='watch.php?id=$id' target='blank_'>CLICK</a>";
}
?>
</div>
<br/><br/>
<br/>
<br/>
</div>
<div id="footer">
Copyright © 2017.
</div>
</div>
</body>
</html>
Ik krijg de code "HTTP ERROR 500" weet iemand waarom?