Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function GetList($dir){
- global $hash;
- $folder = scandir($dir);
- foreach($folder as $file){
- if($file != '.' && $file != '..'){
- if(is_dir($dir.'/'.$file)) {
- } else {
- $hash = md5_file($dir . '/' . $file);
- $sql = "INSERT INTO `mydb`.`filehash` (`Dir`,`FName` ,`Hash`)
- VALUES ('".mysql_escape_string($dir."\\")."', '".mysql_escape_string($file)."', '".$hash."');";
- print $sql."<br>";
- mysql_query($sql);
- }
- }
- }
- }
- print '<html>';
- $host="localhost";
- $user="MyDBuser";
- $pass="1"; //установленный вами пароль
- $db_name="myDB";
- $link=mysql_connect($host,$user,$pass);
- mysql_select_db($db_name,$link);
- GetList("Z:\Home\Localhost\www");
- print '</html>';
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement