Tried all solution but failed to display an image

images php coding issues or problems here.

Moderators: macek, egami, gesf

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

Post by ruturajv » Mon Mar 28, 2005 10:05 pm

Code: Select all

<html>
<head>
</head>
<body>
<?php
$img = "C:\Inetpub\wwwroot\gps1\mumbai.gif";
$im = imagecreatefromgif ($img);
header( 'Content-type: image/gif' );
imagegif($im);
?>
</body>
</html>

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

Who is online

Users browsing this forum: No registered users and 3 guests