RE: [PHP] Image output (Newb question)

From: Date: Fri, 02 Apr 2004 21:31:59 +0000
Subject: RE: [PHP] Image output (Newb question)
Groups: php.general 
Request: Send a blank email to php-general+get-182192@lists.php.net to get a copy of this message
change your script to just this: <?php $link = mysql_connect("localhost", "root", ""); if ($link){ header("Content-type: image/png"); $im = imagecreatefrompng("images/map/map-15x9.png"); imagepng($im); //,"images/".session_id().".png" imagedestroy($im); mysql_close($link); } else{ echo("Not connected."); } ?> Don't have any white space before <?php, if you do have any white space or text before your header("Content-type: image/png"), I believe php will automatically output the Content-type: text/html , so your Content-type: image/png will not work.

« previous php.general (#182192) next »