Advertisement
Wyvern67

Untitled

Jan 19th, 2013
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. Ancien:
  2. <?php
  3.  if ($handle = opendir('.')) {
  4.    while (false !== ($file = readdir($handle)))
  5.       {
  6.           if ($file != "." && $file != "..")
  7.       {
  8.             $thelist .= '<a href="'.$file.'">'.$file.'</a>';
  9.           }
  10.        }
  11.   closedir($handle);
  12.   }      
  13. ?>
  14. <P>List of files:</p>
  15. <P><?=$thelist?></p>
  16.  
  17. Nouveau:
  18. <?php
  19.  if ($handle = opendir('.')) {
  20.    while (false !== ($file = readdir($handle)))
  21.       {
  22.           if ($file != "." && $file != "..")
  23.       {
  24.             $thelist .= '<p><a href="'.$file.'">'.$file.'</a></p>';
  25.           }
  26.        }
  27.   closedir($handle);
  28.   }      
  29. ?>
  30. <P>List of files:</p>
  31. <?=$thelist?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement