Ask: Use PHP's function fpassthru () to show the picture in detail
The idea of a newly-learned PHP may not have been asked, presumably in the sense that:
WAMP environment, Zend Framework +smarty templates
1. Then use Fpassthru to pass a picture in action to show if it is feasible? How to write?
2. Do not use the IMG tag with Fpassthru can pass the picture to the foreground?
------Solution--------------------
... action{
1 can directly output the picture content, for example, with your fpassthru:
PHP code
//open file in binary format $name = './img/ok.png ' $fp = fopen ($name, ' RB ');//Send the appropriate header header ("Content-type:image/png"); Header ("Content-length:"). FileSize ($name));//Send picture and Terminate script fpassthru ($FP); exit;
------Solution--------------------
Apache under the anti-theft chain can be used rewrite_module, with these output file header method to deal with the server will only aggravate the burden.
http://sealbird.iteye.com/blog/976891
------Solution--------------------
discussion
upstairs yesterday i also searched, but tried, did not know where is the problem
the back of the ' RB ' should be the parameter bar this parameter I checked the manual not found so I want to ask to see if there is more useful information
------Solution--------------------
Comment out the header ("Content-length:". FileSize ($imgpath));
Header ("content-type:image/jpg");
, only the picture data stream -