Reaper0167 Posted March 4, 2009 Share Posted March 4, 2009 Picture not displaying, little red x instead. Thought I had this one, guess not. <?php $imgRealPath = "userimages/"; foreach(glob("$imgRealPath/{*.jpg,*.png,*.gif}", GLOB_BRACE) as $fname) { echo '<img src=\"" . $imgWebPath . "/" . baseName($fname) . "\" width="150" border="1"><br/><br/>'; } ?> Link to comment https://forums.phpfreaks.com/topic/147863-solved-little-help-please/ Share on other sites More sharing options...
WolfRage Posted March 4, 2009 Share Posted March 4, 2009 What does the final output look like? Link to comment https://forums.phpfreaks.com/topic/147863-solved-little-help-please/#findComment-776068 Share on other sites More sharing options...
Reaper0167 Posted March 4, 2009 Author Share Posted March 4, 2009 proper size border for the picture, and also has the proper spacing between the borders, but no pictures, just a little red x in the upper corner of the border Link to comment https://forums.phpfreaks.com/topic/147863-solved-little-help-please/#findComment-776073 Share on other sites More sharing options...
WolfRage Posted March 4, 2009 Share Posted March 4, 2009 What I meant was what was the code output. The problem is your use of double and single qoutes. You can see the error in the way the code is highlighted. <?php echo '<img src=\"" . $imgWebPath . "/" . baseName($fname) . "\" width="150" border="1"><br/><br/>'; ?> Should be: <?php echo '<img src="' . $imgWebPath . '/' . baseName($fname) . '" width="150" border="1"><br/><br/>'; ?> Link to comment https://forums.phpfreaks.com/topic/147863-solved-little-help-please/#findComment-776076 Share on other sites More sharing options...
Reaper0167 Posted March 4, 2009 Author Share Posted March 4, 2009 thanks for the help,, but still no images. Link to comment https://forums.phpfreaks.com/topic/147863-solved-little-help-please/#findComment-776091 Share on other sites More sharing options...
WolfRage Posted March 4, 2009 Share Posted March 4, 2009 OK. Sorry with out the rest of the code and seeing what the output is it is hard to troubleshoot beyond that. Good luck though. Link to comment https://forums.phpfreaks.com/topic/147863-solved-little-help-please/#findComment-776095 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.