If PHP does not select an image, the selected image will be printed.

Source: Internet
Author: User
If you do not select an image in PHP, the front-end code of the selected image will be printed to view the image control.
while($row = mysql_fetch_array($result))  {echo'';  }


Background
For ($ I = 1; $ I <10; $ I ++) {$ j = $ I + 1; $ k = $ I + 5; if ($ _ FILES ["file '. $ I. '"] [" error "]> 0) {echo' no image selected '. $ j; $ {"iii ". $ I} = $ _ POST ['detail '. $ k];} else {if (file_exists ("images /". $ _ FILES ["file '. $ I. '"] [" name "]) {echo $ _ FILES [" file '. $ I. '"] [" name "]. 'image filename '. $ j. 'File name already exists; $ {"iii ". $ I} = '';} else {move_uploaded_file ($ _ FILES [" file '. $ I. '"] [" tmp_name "]," images /". $ _ FILES ["file '. $ I. '"] [" name "]); echo" Stored in :". "images /". $ _ FILES ["file '. $ I. '"] [" name "]; $ {" iii ". $ I} = 'Images /'. $ _ FILES ["file '. $ I. '"] [" name "] ;}}


Why do I not select an image and do not output it?


Reply to discussion (solution)

"File '. $ I .'"
This kind of thing cannot get the result you want, it should be
"File {$ I }"

You should change this first.

Isn't PHP variable separation all using '. $ I ..

I changed double quotation marks to single quotes.

Print_r ($ _ FILES) after submission; check what it is.

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.