When the image is clearly uploaded, the image cannot be determined. The following code indicates that an error occurs when I upload an image. is this judgment statement incorrect? For more information, see. Thank you if & nbsp; ($ _ FILES ['logo _ file1'] ['type'] & nbsp ;=& nbsp; "image? Gif ") | & nbsp; when the image is clearly uploaded, the image cannot be determined.
The following code,
I upload images,
Always show:
Error.
Could you tell me this judgment statement,
Wrong?
For more information, see.
Thank you.
If ($ _ FILES ['logo _ file1'] ['type'] = "image? Gif ")
| ($ _ FILES ['logo _ file1'] ['type'] = "image? Jpeg ")
| ($ _ FILES ['logo _ file1'] ['type'] = "image? Jpg ")
| ($ _ FILES ['logo _ file1'] ['type'] = "image? Pjpeg "))
& ($ _ FILES ['logo _ file1'] ['size'] <10485760 )){
Echo "upload an image .";
} Else {
Echo "error .";
}
------ Solution --------------------
If ($ _ FILES ["file"] ["type"] = "image/gif ")
------ Solution --------------------
($ _ FILES ["file"] ["type"] = "image/jpeg ")
------ Solution --------------------
($ _ FILES ["file"] ["type"] = "image/pjpeg "))
& ($ _ FILES ["file"] ["size"] <20000 )){
Echo "upload image.";} else {
Echo "error .";}
Correct code, help you try it, use "", don't use''
------ Solution --------------------
1. first remove all types of judgment (the remaining bytes) to see if there will be any errors
2. Then, add only one type of gif to determine whether an error will occur.
If 1. correct, 2. incorrect, check your php file encoding.