How to display image?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

How to display image?

Post by ianhull »

Hi Can anyone help me display a image in my page?
The image path is stored in the database.

everytime I try <?php echo $image ?> all I see is the image path

What else do i need to do?

Thanks
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

Code: Select all

echo "<img src=\"".$image."\">";
you still have to use the correct html in order display the image or anything else that would require html. You know get to embed it into your php.
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

Thanks for that,

I thought that it would automatically do it.

Thanks again
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

nope!

php is php, html is html.

use php to create html
Post Reply