You need to insert the following lines after this line:
Header("Content-type: image/gif");

$im = ImageCreateFromString ($fileContent); 
ImageGif ($im); 

and then remove this line: echo $fileContent;
That should do it.


-----Original Message-----
From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 8:32 PM
Subject: RE: [PHP] Unable to display images on browser

Hello, Thanks for your help.  This is what I have for file1.php and
ddownloadfile.php.  What I want is to click on "Donwnload now" link and be
able to get the file out of the database and display it on the browser.
Thank you in adavance, -Teresa
   while ($row = mysql_fetch_array($result)) 
//      <img src=\"ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>\"
      <a href="ddownloadfile.php?fileId=<?php echo $row["PicNum"]; ?>" > 
         Download Now 

$dbQuery = "Select PicNum, size, type, description, Image"; 
$dbQuery .= " FROM Images WHERE PicNum = $fileId"; 
$result = mysql_query($dbQuery) 
or die ("Could not get file list: " . mysql_error() ); 
echo "Sent Query successfully<br>"; 
if ( mysql_num_rows($result) == 1) 
$fileType = @mysql_result($result,0, "type"); 
$fileContent = @mysql_result($result, 0, "Image"); 
$filedesc = @mysql_result($result,0, "description"); 
$filenum = @mysql_result($result,0, "PicNum"); 
Header("Content-type: image/gif"); 
echo $fileContent; 
echo "Record does not exist"; 
} // else 

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to