I searched internet and I could not find a solution for the problem. I have a form and when I submit only text fields there is no problem. But when I add file input and submit the form I get undefined index error.
HTML CODE
<form method="post" action="add.php" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="10485760">
<input type="text" name="topic" style="width:300px;" value="cars" />
<input type="file" name="file1" id="file1" />
<input type="submit" name="submit" value="Add"/>
</form>
PHP CODE
if(isset($_POST['submit']))
{
// Form
}
else echo'NOOO';
This code always give NOOO when uploading file. I have controlled php.ini and upload is on.
enctype="multipart/form-data"in form tag??if(isset($_POST['submit']))code toadd.php? Because, your form is submitted there.$_FILESto obtain any file requests. However, the way you have it set up. It should work. What problems are you having exactly?