Jump to content

imageJPEG and Header()


tonym

Recommended Posts

I have this, which, apart from the header() is from the manual:

<?php ob_start(); ?>

<html>

<body>

 

<?php

$im = imagecreatetruecolor(120, 20);

$text_color = imagecolorallocate($im, 233, 14, 91);

imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);

header('Content-type: image/jpeg');

imagejpeg($im);

imagedestroy($im);

?>

</body>

</html>

<?php ob_end_flush(); ?>

All I see in the browser is the url of the script. If I remove the header line, I see the binary source of the image. Any suggestions please?

Tony

 

Link to comment
https://forums.phpfreaks.com/topic/184044-imagejpeg-and-header/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.