<h1>Upload de Arquivos</h1>
<form name="enviarImagem" action="enviar.php" method="POST" enctype="multipart/form-data">
Arquivo<br> <input type="file" name="img" value=""><br><br>
<input type="submit" value="Enviar" name ="enviar">
<?php
$name = $_FILES["img"]["name"];
$temp = $FILES["img"]["tmp_name"];
/*var_dump($name);
var_dump($temp);*/
$banco = new mysqli("localhost", "root", "", "projeto");
$sql = "INSERT INTO imagem (nome) VALUES ('{$name}')";
$banco->query($sql);
$banco->close();
move_uploaded_file($temp, "./imagens/".$name);
header("Location: upload.php");
?>