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... Quote 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 Quote 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] Quote 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.. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/25561-display-all/#findComment-116694 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.