Php file upload problems? Html page code: HTMLcode & lt ;! DOCTYPEhtmlPUBLIC & quot;-// W3C // DTDHTML4.01Transitional // EN & quot; http://www.w3.org/TR/html4/loose.dtd& php file Upload question?
Html page code:
HTML code
File UploadFile Upload
Php page code
PHP code
0) echo "Upload failed !! "; Else echo" Upload successful !! "; If ($ _ FILES ['userfile'] ['type']! = 'Text/plain ') echo "select the correct file type !! ";?>
Problems:
Notice: Undefined index: userfile in G: \ apache \ htdocs \ php \ upload. php on line 4
Upload successful !!
Notice: Undefined index: userfile in G: \ apache \ htdocs \ php \ upload. php on line 8
Select the correct file type !!
What's going on? According to the information in the book, the uploaded file cannot be correctly determined whether it is in text format. is it on $ _ files? I haven't figured it out for a long time. I hope someone can help me. thank you ....
------ Solution --------------------
Print_r ($ _ FILES); // Check