-1
Undefined index: mfile    
<html>
<head>

</head>
    <body>
        <form action="upload_imagedetail.php" method="post">
            <input type="file" name="mfile"><br/>
            <input type="submit" name="msubmit">
        </form>
    </body>
</html> 
Undefined index: mfile        
<?php   
    if(isset($_POST['msubmit'])){
        if($_FILES['mfile']){
            echo " Hello <br/>";
            echo "<pre>";
            echo $_FILES['mfile']['tmp_name'] . "<br/>";
            echo "</pre>";
        }
    }
?>

After submitting the form I am getting

Undefined index: mfile in C:\xampp\htdocs\testing_websites\upload_detail.php on line 3

Pankaj Makwana
  • 3,030
  • 6
  • 31
  • 47
manoj03h
  • 37
  • 7

1 Answers1

0

You have not added enctype="multipart/form-data" in your form tag. Please add that and try again.

        <form action="upload_imagedetail.php" method="post" enctype="multipart/form-data">
            <input type="file" name="mfile"><br/>
            <input type="submit" name="msubmit">
        </form>
Pankaj Makwana
  • 3,030
  • 6
  • 31
  • 47