Advertisement
garfield

[PHP]: Listar Diretório C/ Pastas em tabela e imagens.

Nov 5th, 2011
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. /*=================================================================
  2.          _ ____         _____             __
  3.         (_)  _ \ ___  |_   _|__  __ _|  \/  |
  4.         | | |_) / __|   | |/ _ \/ _` | |\/| |
  5.         | |  __/\__ \   | |  __/ (_| | |  | |
  6.         |_|_|   |___/   |_|\___|\__,_|_|  |_|
  7.  
  8.             Criado Por SuYaNw Dácio
  9.             www.ips-team.blogspot.com
  10.    
  11. =================================================================*/
  12.  
  13. $dir = opendir(".");
  14. $contar = 0;
  15. echo "<table border='0'  cellspacing='0'><tr><Td>>Pasta:</b></tr>";
  16. while ($ei = readdir($dir))
  17. {      
  18.     if(!strstr($ei,'.exe'))
  19.     {
  20.         $cor = 0;
  21.        
  22.         if($contar % 2)
  23.             $cor = "#9ACD32";
  24.         else
  25.             $cor = "#FFFF00";
  26.        
  27.         if(is_dir($ei))
  28.             echo "<tr><td bgcolor='$cor'><img src='http://images-2.findicons.com/files/icons/765/xedia/128/folder.png' width='18'/><a href='$ei' > $ei</a>"."</td></tr><br>";
  29.         else
  30.             echo "<tr><td bgcolor='$cor'><img src='http://images-5.findicons.com/files/icons/2166/oxygen/48/document_import.png' width='18'/><a href='$ei' >$ei</a>"."<br></td></tr>";
  31.         $contar++;
  32.     }
  33. }
  34. echo "</table>";
  35. closedir($dir);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement