Jump to content

can anyone see what wrong with this script


madspof

Recommended Posts

i cannot get this script to work
<?php
   
function scan_folder($dir) {
    $handle = opendir($dir);
   
    while ($file = readdir($handle)) {
        if (is_dir("$dir\\$file")) {
            if (!ereg("^\.+", $file)) {
                $files .= scan_folder("$dir\\$file");
            }
        } else {
            if (@eregi($_POST['matches'], $file)) {
                $files .= "$dir\\$file" . "\n";
            }
        }
    }
    closedir($handle);
   
    return $files;
}

// Add the Directory root you want to scan

$dir = "C:\stuff4free\newsite\music";

// This is how you use the function. Simple!

echo scan_folder($dir);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.