Page 1 of 1

strange image display

Posted: Thu Apr 24, 2008 8:08 pm
by iamnotcoward
Hey, I wrote some code to display images on our website. It worked fine before I modified other irrelevant code, at least I think. All of sudden, those images are not displayed any more yet I can still see the content as text/html type, not as the supposed image/jpeg type. Below code used to display images:
$result = db_query ($sql_get_image);
$img = db_result_bin($result, 0, "$mode_trns");
$img_type = db_result($result, 0, "${mode_trns}Type");
header("Content-Type: $img_type");
echo $img;
where $img and $img_type the image and its corresponding type stored in database and I even printed out the value of $img_type on the page:
image_type: image/jpeg
However, no image displayed and the page info on firefox says:
Type: text/html
Can some tell me where my problem is?
Thanks a lot in advance

Re: strange image display

Posted: Mon Apr 28, 2008 1:59 am
by iamnotcoward
Still haunted by this problem, can someone explain to me why the header function does not work in my code?

Thanks a million

Re: strange image display

Posted: Tue Apr 29, 2008 10:44 pm
by iamnotcoward
Problem solved. It's an extra blank line at the end of one of my included files that caused that problem, should've turned on the warning switch earlier. :roll: