Submission form appears notice:undefined Index:myfile

Source: Internet
Author: User
As shown in title, there was an error notice:undefined index:myfile in D:\WWW\course\admin\alluser.php on line 10 when submitting the form,
The contents of the form cannot be passed, and a null value appears.


PHP Code:
Include_once (".. /login/config/config.php ");
if (!empty ($_files["myfile")) {
$file = $_files["MyFile"];
}
if ($_files["myfile" ["Error"] > 0)
{
echo "Error:". $_files["MyFile" ["Error"]. "
";
}
Else
{
echo "Upload:". $_files["MyFile" ["Name"]. "
";
echo "Type:". $_files["MyFile" ["type"]. "
";
echo "Size:". ($_files["MyFile" ["size"]/1024). The Kb
";
echo "Stored in:". $_files["MyFile" ["Tmp_name"];
}
$filename =$_files[' myfile ' [' name '];
$filepath =$_files[' myfile ' [' tmp_name '];
$filepath = "";
echo "";
?>


Reply to discussion (solution)

form if you want to upload a file to add enctype= "Multipart/form-data"

 
  

Upstairs positive solution submit file need add: enctype= "Multipart/form-data"

form if you want to upload a file to add enctype= "Multipart/form-data"


Thank you ~ ~ The problem has been resolved, as if can upload ~ ~ Thank you very much ~

Upstairs positive solution submit file need add: enctype= "Multipart/form-data"


Thank you ~ ~ Thank you very much ~
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.