Display text and image from database

images php coding issues or problems here.

Moderators: macek, egami, gesf

chesterben
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Mar 23, 2005 12:42 am
Contact:

Display text and image from database

Postby chesterben » Wed Mar 23, 2005 12:58 am

can anyone help to display image and text together from databse?? i currently doing a project about a music store web page. i want to display info af a particular album to user. the form is like an image on the left and some text on the right side. the image and text is retrieved from database(mySQL). the whole idea is someone input all the info including the image in a form and then it store in database. after that it display to user accordingly....my question is how to display all the info and image to user???can anyone help...thankz...........

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

Postby ruturajv » Wed Mar 23, 2005 7:50 pm

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

chesterben
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Mar 23, 2005 12:42 am
Contact:

Postby chesterben » Wed Mar 23, 2005 11:26 pm

thankz for reply.......i still don't understand how to do....sorry, i'm new in php..can u explain to me in detail? or give an example...plzzz...thankzz....

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

Postby ruturajv » 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;
?>

chesterben
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Mar 23, 2005 12:42 am
Contact:

Postby chesterben » Fri Mar 25, 2005 6:10 am

thnks dudes!!!
thnks for the answer!!!! finally i manage to do it!!! coO!L!L
heheh!


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 2 guests