user893856
user893856

Reputation: 1029

I output a valid gif, but I only see its content, what should I do?

I had an "older" server, now I upgraded to newest. I have something like this: img src="s.php", the s.php creates a GIF output. When I directly call this script, I only see the content of the image, instead of the actual picture. I saved the picture, it has no bug.

Upvotes: 0

Views: 63

Answers (2)

check123
check123

Reputation: 2009

Use

ob_start();  
header('Content-Type: image/gif');  
echo //your image
ob_end_flush();

Upvotes: 0

genesis
genesis

Reputation: 50974

Add this before any output

header("Content-Type: image/gif");

Upvotes: 2

Related Questions