Spray62 Posted July 7, 2013 Share Posted July 7, 2013 Hi, I've been trying to display a group of images on a webpage that are saved in a folder. The directory of where the images are stored is images/gallery/flowers/ I'm stuck on what the small segment of PHP code would be to do this. Help would be greatly appreciated and thank you! Link to comment https://forums.phpfreaks.com/topic/279935-displaying-images-from-a-folder-php/ Share on other sites More sharing options...
litebearer Posted July 7, 2013 Share Posted July 7, 2013 Are you saving the image names anywhere (ie in a db)? if not, you can use GLOB to get the image names. then loop thru the names to display the images. Link to comment https://forums.phpfreaks.com/topic/279935-displaying-images-from-a-folder-php/#findComment-1439777 Share on other sites More sharing options...
thara Posted July 7, 2013 Share Posted July 7, 2013 I'm stuck on what the small segment of PHP code would be to do this. Where is your code? Link to comment https://forums.phpfreaks.com/topic/279935-displaying-images-from-a-folder-php/#findComment-1439786 Share on other sites More sharing options...
Spray62 Posted July 7, 2013 Author Share Posted July 7, 2013 There is no db involved and as for the code I'm stuck on where to start with it. I briefly tried some GLOB code that I do not have on me right now and the images displayed but displayed all ten images horizontal across the page when It would need to be three horizontal then another 3 underneath etc. Any ideas on how to break them up so its three on each line? Or even the code needed to display them images using GLOB in general? Thanks Link to comment https://forums.phpfreaks.com/topic/279935-displaying-images-from-a-folder-php/#findComment-1439797 Share on other sites More sharing options...
thara Posted July 7, 2013 Share Posted July 7, 2013 Use HTML and CSS to change your page layout Link to comment https://forums.phpfreaks.com/topic/279935-displaying-images-from-a-folder-php/#findComment-1439800 Share on other sites More sharing options...
Spray62 Posted July 7, 2013 Author Share Posted July 7, 2013 Thanks thara, I'm still new to this so any ideas what code it would be to alter it and stop it from all displaying on the one line? Link to comment https://forums.phpfreaks.com/topic/279935-displaying-images-from-a-folder-php/#findComment-1439816 Share on other sites More sharing options...
jcbones Posted July 7, 2013 Share Posted July 7, 2013 Just set the division width, and they will automatically stack on each other. Link to comment https://forums.phpfreaks.com/topic/279935-displaying-images-from-a-folder-php/#findComment-1439819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.