bemax Posted May 21, 2009 Share Posted May 21, 2009 Is someone who can help me; I'm trying to get an image from a folder and show it: Here is my code, logos is the directory; the problem is that I'm getting only the name of the image! $handle=opendir('../logos/'); while (false!==($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "".$file."\n"; } } closedir($handle); Thanks Link to comment https://forums.phpfreaks.com/topic/159120-get-image-from-a-folder/ Share on other sites More sharing options...
jsschmitt Posted May 21, 2009 Share Posted May 21, 2009 If you are trying to display the actual picture... change echo "".$file."\n"; to echo "<img src'=".$file."'>\n"; Link to comment https://forums.phpfreaks.com/topic/159120-get-image-from-a-folder/#findComment-839225 Share on other sites More sharing options...
jkewlo Posted May 21, 2009 Share Posted May 21, 2009 hemm. use [ code ] [ / code ] tags when posting code >< Link to comment https://forums.phpfreaks.com/topic/159120-get-image-from-a-folder/#findComment-839260 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.