you need to have a different image script
which outputs image, using content-type: image/png
Display text and image from database
Moderators: egami, macek, gesf
- ruturajv
- php-forum Super User
- Posts: 1279
- Joined: Sat Mar 22, 2003 9:42 am
- Location: Mumbai, India
- Contact:
page where out put is shown...
show-image.php
Code: Select all
<img src="/show-image.php?id=some_id" />
<div>
<?php
echo $row['content']; // from mysql
?>
show-image.php
Code: Select all
<?php
// be sure no html is outputted.
...
$imagecontent = ...;
header('Content-Type: image/png'); // considering image is png content
echo $imagecontent;
?>