View Single Post
  #2 (permalink)  
Old 2003-09-29, 03:10 PM
barand barand is offline
Member
 
Join Date: May 2003
Posts: 47
barand
Default

I remember seeing a an article somewhere on this but can't find it now. From memory :-

The principle is to create a php script in a separate file, which echoes the image, and place the image with an img tag.

:: myimage.php ::

Code:
$id = $_GET['id'];
$sql = "SELECT theimage FROM thetable WHERE id=$id";
$res = mysql_query($sql);
list($image) = mysql_fetch_row($res);

header("Content-Type: image/jpg");
echo $image;
---------------------------------------
:: mypage.php ::
Code:
<html>
<body>

<img src="myimage.php?id=1" >

</body>
</html>
Hope I got it right
__________________
Barand
Reply With Quote