Display text and image from database

A

Anonymous

Guest
you need to have a different image script
which outputs image, using content-type: image/png
 
page where out put is shown...

Code:
<img src="/show-image.php?id=some_id" />
<div>
<?php
echo $row['content']; // from mysql
?>

show-image.php
Code:
<?php
// be sure no html is outputted.
...
$imagecontent = ...;
header('Content-Type: image/png'); // considering image is png content
echo $imagecontent;
?>
 
Back
Top