I'm working on an app.
My HTML code:
<form action="invio_segnalazione.php" method="post" enctype="multipart/form-data">
<br><br>        Inserire immagine:
<br>        <input type="file" name="file">
<br><br><br><br>
<table class="center"><tr>
<td><input type="reset" class=button value="Cancella"></td>
<td align=left><button type="submit" class=button name="submit">Invio</td></tr>
</table>
</form>
The PHP code is:
if(isset($_POST['submit']))
{
$file = $_FILES['file'];
print_r($file);
$nomeImg = $_FILES['file']['name'];
}
The error is:
Notice: Undefined index: file in D:\XAMPP\htdocs\Esercizi_SQL\Sito peppe testa\invio_segnalazione.php