Tried all solution but failed to display an image

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Mon Mar 28, 2005 10:05 pm

Code: Select all

$img = "C:\Inetpub\wwwroot\gps1\mumbai.gif";
$im = imagecreatefromgif ($img);
header( 'Content-type: image/gif' );

you can't do both (displaying HTML and rendering image) in a single page...
you have to do... image display ie content-type: image/png
in a different page.
and then call that page in img tag

Code: Select all

<img src="image.php?id=someid" />

Post Reply