Ask a question that shows a picture

Source: Internet
Author: User
Tags readfile
I want to make a PHP page with the Find image function, with id=xx,php in the URL to get the ID value with get. If a picture with the same file name and ID is found, it displays "Load.gif" if it is not found. I am pure novice, referring to the example of the Internet to write a paragraph, but there is no way to display pictures. Please guide the experts.
The code is as follows:
 
  


Reply to discussion (solution)

ReadFile read the picture read the binary bar

Echo ';
You can display the pictures on the Web page.

$filename = "/' $id '. gif";
Why do you want price quotes?
$filename = "/$id. gif";

Also: remove echo, remove BOM header

Then there is, you are not likely to put the picture on the root of the filesystem?

I want to make a PHP page with the Find image function, with id=xx,php in the URL to get the ID value with get. If a picture with the same file name and ID is found, it displays "Load.gif" if it is not found. I am pure novice, referring to the example of the Internet to write a paragraph, but there is no way to display pictures. Please guide the experts.
The code is as follows:

 
  



Wrote a demo to see.
$id = Isset ($_get[' id ')? $_get[' id ']: 0; $filename = intval ($id). ". GIF "; if (file_exists ($filename)) {    echo";} else{    echo ';}

Thank you very much, the problem has been solved smoothly. The original wrong so outrageous, ashamed. Incidentally, $id = Isset ($_get[' id ")? $_get[' id ': 0; What do you mean?

Thank you very much, the problem has been solved smoothly. The original wrong so outrageous, ashamed. Incidentally, $id = Isset ($_get[' id ")? $_get[' id ': 0; What do you mean?


Isset detect if the variable is set
Trinocular operation, if set, execute? The following, if not on the execution: the back of the


Thank you very much, the problem has been solved smoothly. The original wrong so outrageous, ashamed. Incidentally, $id = Isset ($_get[' id ")? $_get[' id ': 0; What do you mean?


Isset detect if the variable is set
Trinocular operation, if set, execute? The following, if not on the execution: the back of the


Thanks for the answer! Thank you!
  • 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.