Re: this is my code i am not getting images throuh php script [message #176568 is a reply to message #176564] |
Mon, 09 January 2012 17:35 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma:
|
Senior Member |
|
|
Erwin Moller wrote:
> On 1/9/2012 4:37 PM, Captain Paralytic wrote:
>> On Jan 9, 3:23 pm, srikanth<sritullimi...@gmail.com> wrote:
>>> <?php
>>> header("Content-type:image/jpeg");
>>> $fp=fopen("F:/Mydocuments/Certificates/Passport/Passport.jpg","r");
>>> echo
>>> fread($fp,filesize("F:/Mydocuments/Certificates/Passport/Passport.jpg");
>>> ?>
>>
>> Not surprising really since you have a syntax error (missing ")").
>
> Yes.
> srikanth, to debug such pieces of code you can simply change the header to:
> header("Content-type:text/html");
>
> and see what it says.
> (Or check the rrorlog if you have one up-and-running).
>
> Regards,
> Erwin Moller
>
>
The minimal code is something like
send_passport.php
-----------------
<?php
header("Content-Type: image/jpeg");
readfile("F:/Mydocuments/Certificates/Passport/Passport.jpg");
?>
<<<...and no whitespace here!!!
I mistrust using things that are designed for text strings for binary files.
|
|
|