Re: IMG generation
| From: | Zipkid | Date: | Wed, 11 Oct 2000 19:29:01 +0000 |
| Subject: | Re: IMG generation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19683@lists.php.net to get a copy of this message | ||
Mark Olbert wrote:
>
> I have an html file that looks like this:
>
> <html>
> <img src="/php/displayimage.php">
> </html>
>
> When I browse this file, I get a "premature end of script headers error".
>
> If I execute the file from the command line and capture the output, I get
> the following (I've truncated some of the later lines):
>
> X-Powered-By: PHP/4.0.2
> Content-type: image/jpeg
>
> ÿØÿà^@^PJFIF^@^A^A^@^@^A^@^A^@^@ÿþ^@;CREATOR: gd-jpeg v1.0 (using IJG JPEG
> v62), quality = 30
> ÿÛ^@C^@^[^R^T^W^T^Q^[^W^V^W^^^\^[
> (B+(%%(Q:=0B`Ued_U][jx~^Y~^Ajq~^Ps[]~^Eµ~^F~^P~^^£«
> ^KÿÄ^@µ^P^@^B^A^C^C^B^D^C^E^E^D^D^@^@^A}^A^B^C^@^D^Q^E^R!1A^F^SQa^G"q^T2~^A~
> ^Q¡)*
>
> This >>looks<< like image data. So why is the browser rejecting it?
>
in /php/displayimage.php, before any other output you have to put
header( "Content-type: image/jpeg" );
so long
--
Stefan - Zipkid - Goethals
YourNet - Open source web design & Site management.
http://www.yournet.be
mailto:stefan@yournet.be