Re: dynamic <img>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Anugrah Widya wrote:
dear friends :),

i have problem with dynamic image displaying

here the snippets

thumb.php
<?php
header("Content-type: image/jpg");
$file = "data/original/filename.jpg";
readfile($file);
?>

img.php
<img src="thumb.php?filename.jpg" />

problem is i always get broken images, someone know how to fix this ?

Rather than viewing img.php, go directly to thumb.php?filename.jpg in your browser. Change the content-type to text/plain and see what you get in the browser.

You may also want to remove the ?> at the end of thumb.php - it's not needed and may be adding whitespace to the image you are returning.

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux