Питане за този урок.

RhythmiX

Registered
Значи в този урок е показано как да се търси в дадена директория. http://web-tourist.net/login/login/view.php?st=650

та аз искам да попитам как мога да направя да търся в data.bg да речем ?
И да търся само определен вид файлове ?
 
Код:
<?php

//Specify the path of your cd. PHP must have access on your drive for cd.
//It is working on me using Windows 2000 with php5 installed.
$path="d:/music/";
function showfiles($path){
    if (substr($path,-1) <> "/")
    $path=$path."/";
    $file=scandir($path);

    while (list($key, $val) = each($file)) {
        if (filetype($path.$val)=="dir" && $val<>".." && $val<>".")   {
            $count++;
            print "<font face=arial size=1 color=blue><b>".$count.". ".$path.$val."</b></font>\n";
            showfiles($path.$val);
        }elseif (filetype($path.$val)=="file") {
            $mp3=explode(".",$val);
            if (in_array("mp3",$mp3)||in_array("MP3",$mp3)){
                $count1++;
                print "<font face=arial size=1><b>".$count1.". ".$val."</b></font>\n";
            }
        }
    }
}
?>
<html><title>Recursive MP3 List</title>
<body>
<pre>
<?php print showfiles($path);?>
</pre>
</body>
</html>

Това е да търси в хард диска ти само песни незнам как се търси в дата та :wink:
 

Back
Горе