Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display image from a folder.

Status
Not open for further replies.

lalan7

Technical User
Aug 5, 2004
11
CA
I need to find how to display image from a folder in a web page. exemple inside /images/ i have 3 .png

toto.png toto1.png toto2.png

i need to display this 3 file in a single web page without clicking on it .

Thanks
 
No php involved:

<html>
<body>
<img src=toto.png><img src=toto1.png><img src=toto2.png>
</body>
</html>
 
Since you are asking in the PHP forum I assume you'd like to use PHP to create that page, eh?
Also, could you explain what the thing about "not clicking on it" means. It almost sounds as if you want to display all images that are in a folder automatically.
If so, then you should look at:
PHP directory reading functions After that it's just printing out some kind of HTML structure the way ericbrunson has shown above.
 
I need to display a dynamic folder content in html. the... not clicking ... is because if a folder contain 3 .png file i need to display them automaticly in a html format. (like img src=)


 
1: make a dirlist (or find one)
2: modify the dirlist to check for .png files
3: make the dirlist echo out <img src="<?php echo $dirlist[$id]; ?>" />

you need to wrap it in loops, some nested if/else, but it's not a very complexed script.

I think this one you can do for your self, seeing as it's very easy if you just tap some on your keyboard.

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top