Return an image instead of HTML - PHP

by Naveenkumar 2012-08-20 12:32:54

Hi,


$imageFileName='hello.gif';
header("Content-type: image/gif");
readfile($imageFileName);
?>



If you're want to use a jpg (resp. png) image, you must also change the 'image/gif' content-type into 'image/jpeg' (resp. 'image/png').


520
like
0
dislike
0
mail
flag

You must LOGIN to add comments