I am writing PHP code in Netbeans. Program is generating the correct output but the following notice is generating on the browser.
Notice: Undefined index: name in C:\xampp\htdocs\PhpProject3\index.php on line 2
Notice: Undefined index: name in C:\xampp\htdocs\PhpProject3\index.php on line 3
Notice: Undefined index: name in C:\xampp\htdocs\PhpProject3\index.php on line 4
Notice: Undefined index: name in C:\xampp\htdocs\PhpProject3\index.php on line 5
Here is my code:
<?php
echo $name=$_FILES['name']['name'].'<br>';
echo $size=$_FILES['name']['size'].'<br>';
echo $type=$_FILES['name']['type'].'<br>';
echo $tmp_name=$_FILES['name']['tmp_name'];
?>
<form action="index.php" method="POST" enctype="multipart/form-data">
<input type="file" name="name"><br/><br/>
<input type="submit" value="Submit">
</form>