Jump to content

Loading Images not working


perezf

Recommended Posts

<?php $dir = realpath("photos/");
if (is_dir($dir)) {
if($dh=opendir($dir)) {
while(($file=readdir($dh))!=false) {
if(substr($file,0,1)!=".") echo "<img src=\"".$file."\"><br>".$file."<br><br>\n";
}
closedir($dh);
}
} else echo "Folder error. Try using ".realpath(".")." as a starting point."; ?>



what i am trying to do is load the images from the photos folder
Link to comment
https://forums.phpfreaks.com/topic/10264-loading-images-not-working/
Share on other sites

[!--quoteo(post=376347:date=May 23 2006, 10:26 AM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ May 23 2006, 10:26 AM) [snapback]376347[/snapback][/div][div class=\'quotemain\'][!--quotec--]
For future reference, you should really continue the discussion in your original topic.

Anyway, "not working" isn't very specific. Are you getting errors? does the folder you're using not contain images? does it contain more than images?
[/quote]

it does not load anything when i specify the folder
but if i dont specify it then it works

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.