gilestodd Posted May 22, 2012 Share Posted May 22, 2012 Im using this code to call all the images in a folder: $handle = opendir(dirname(realpath(__FILE__)).'/images/'); while($file = readdir($handle)){ if($file !== '.' && $file !== '..'){ echo '<img src="admin/img/uploads/'.$file.'" border="0" />'; } } My html says the images are present but they aren't visable on screen: <div id="contentbody"> <img src="admin/img/uploads/send-button-sprite copy.png" border="0" /> <img src="admin/img/uploads/test" border="0" /> <img src="admin/img/uploads/counter.jpg" border="0" /> <img src="admin/img/uploads/send-button-sprite.png" border="0" /> </div> Any help is much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/262920-images-called-from-folder-wont-display-on-screen/ Share on other sites More sharing options...
ManiacDan Posted May 22, 2012 Share Posted May 22, 2012 Location of the images: realpath(__FILE__)).'/images/' Location you're trying to serve them from: admin/img/uploads/ Why do you think /images/ is going to be the same folder as /admin/img/uploads? Quote Link to comment https://forums.phpfreaks.com/topic/262920-images-called-from-folder-wont-display-on-screen/#findComment-1347628 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.