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 ~