daily pastebin goal
44%
SHARE
TWEET

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

garfield Nov 5th, 2011 128 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top