GremlinP1R Posted October 30, 2006 Share Posted October 30, 2006 Hi there...How would I be able to display all pic in on dir on a page??Can some one please help... Link to comment https://forums.phpfreaks.com/topic/25561-display-all/ Share on other sites More sharing options...
Gruzin Posted October 30, 2006 Share Posted October 30, 2006 you could store all pic names in db and then loop the result.Regards,George Link to comment https://forums.phpfreaks.com/topic/25561-display-all/#findComment-116636 Share on other sites More sharing options...
.josh Posted October 30, 2006 Share Posted October 30, 2006 [code]<?php if ( $img_dir = @opendir('../images/') ) { while ( false !== ($img_file = readdir($img_dir)) ) { // add checks for other image file types here, if you like if ( preg_match("/(\.jpg)$/", $img_file) ) { echo "<img src = '$img_file'>"; } } closedir($img_dir); } else { echo "wrong path"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/25561-display-all/#findComment-116639 Share on other sites More sharing options...
GremlinP1R Posted October 30, 2006 Author Share Posted October 30, 2006 Thanx that code works, sort of...it makes places for all inmages, counts them and create a blok but its not displaying...Any reason why it would not display??Thanx.. Link to comment https://forums.phpfreaks.com/topic/25561-display-all/#findComment-116647 Share on other sites More sharing options...
trq Posted October 30, 2006 Share Posted October 30, 2006 This isn't a place for handouts.... have you attempted anything yourself? can we see YOUR code and let us know any errors YOu might be having. Link to comment https://forums.phpfreaks.com/topic/25561-display-all/#findComment-116694 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.