Display text and image from database

images php coding issues or problems here.

Moderators: egami, macek, gesf

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

Wed Mar 23, 2005 7:50 pm

you need to have a different image script
which outputs image, using content-type: image/png

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

Thu Mar 24, 2005 10:03 pm

page where out put is shown...

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;
?>

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest