2
I have a problem trying to upload an image by PHP.
Field on the form:
<input type="file" name="imagem" id="ff_imagem_serv"/>
Then when I give Submit it executes the code:
$name = $_FILES['imagem']['name'];
$tmp_name = $_FILES['imagem']['tmp_name'];
$location = "imagens_noticia/$name";
move_uploaded_file($tmp_name,$location);
Can someone help me?
What’s the matter?
– stderr
Does not work. From the first two lines error $name = $_FILES['image']['name']; $tmp_name = $_FILES['image']['tmp_name'];
– Lucas Vilela
Error: Undefined index: image
– Lucas Vilela