Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2.  
  3. function GetList($dir){
  4.    
  5.     global $hash;
  6.    
  7.     $folder = scandir($dir);
  8.     foreach($folder as $file){
  9.         if($file != '.' && $file != '..'){
  10.             if(is_dir($dir.'/'.$file)) {
  11.              
  12.             } else {
  13.                 $hash = md5_file($dir . '/' . $file);
  14.     $sql = "SELECT `Hash` FROM `mydb`.`filehash` WHERE `Dir`='".mysql_escape_string($dir."\\")."' AND `FName`='".mysql_escape_string
  15.  
  16. ($file)."'";
  17. //    print $sql."<br>";
  18.     $result = mysql_query($sql);
  19.     $result = mysql_result($result,0);
  20.  
  21.     print $hash."=".$result."<br>";
  22.  
  23.             }
  24.         }
  25.     }
  26. }
  27.  
  28.  
  29. print '<html>';
  30.  
  31.     $host="localhost";
  32.     $user="MyDBuser";
  33.     $pass="1"; //установленный вами пароль
  34.     $db_name="myDB";
  35.     $link=mysql_connect($host,$user,$pass);
  36.     mysql_select_db($db_name,$link);
  37.  
  38.  
  39. GetList("Z:\Home\Localhost\www");
  40. print '</html>';
  41.  
  42. mysql_close();
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement