Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

show all jpgs in dir
Sunday, January 21st, 2007 at 7:05:43pm MST 

  1. <html>
  2. <body>
  3.  
  4. <?php
  5.  
  6. //  Define  the  full  path  to  your  folder,  shouldn't  need  changing
  7. $path  =  "./";
  8.  
  9. //  Open  the  folder
  10. $dir_handle  =  @opendir($path)  or  die("Unable  to  open  folder");
  11.  
  12. //  Loop  through  the  files
  13. while  (false  !==  ($file  =  readdir($dir_handle)))  {
  14.  
  15. //  Prevent  this  file  itself  being  shown
  16. //  If  you  want  it  to  not  display  any  other  files
  17. //  enter  more  of  these
  18. if($file  ==  "index.php")
  19. continue;
  20. //Prevent  folders  showing
  21. if($file  ==  ".")
  22. continue;
  23. if($file  ==  "..")
  24. continue;
  25.  
  26. //  Display  the  results
  27. echo  "<img  src='$file'  alt='$file'><br  />";
  28.  
  29. }
  30.  
  31. //  Close  it
  32. closedir($dir_handle);
  33.  
  34. ?>
  35.  
  36. </body>
  37. </html>

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
fantasy-obligation