Jump to content

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

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?
[!--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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.