Help ~ An error occurred when uploading images ~ Php part & lt ;? & Nbsp; if (! Seek & quot;); help ~ An error occurred when uploading images ~
Php section
If (! Empty ($ _ POST ["tjsp11"]) {
$ File_path = "../uploadpic /";
$ Pic_type = array (". jpg", ". png", ". gif ");
$ Up_name = $ _ FILES ["tjsp11"] ["name"];
// Echo $ up_name;
$ Pic_name = substr ($ up_name, strrpos ($ up_name ,"."));
$ Up_date = date ("ymdhis ");
If (! In_array ($ pic_name, $ pic_type )){
Echo "Error Pic Type ";
Exit ();
}
If ($ _ FILES [u_file] [size]> = 0) {// no size limit
Echo "the image cannot exceed 1 MB ";
Exit ();
}
Else {
Move_uploaded_file ($ _ FILES ["tjsp11"] ["tmp_name"], $ file_path. $ up_date. $ pic_type );
}
}
?>
Html section
I tried echo $ up_name; without any output content. I don't know where the problem is. I still cannot upload images. For more information, pick the wrong one.
------ Solution --------------------
To upload images, add
------ Solution --------------------
It is recommended to take a look here: http://www.w3school.com.cn/php/php_file_upload.asp