Jump to content


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


Paging and searching

Recommended Posts

ok so i have a script that displays all files in a folder!
here it is:
           $dirpath = "./torrents";

    $dh = opendir($dirpath);
        while (false !== ($file = readdir($dh))) {
                       if (!is_dir("$dirpath/$file")) {
       $fileend = substr($file, -8);
             $fileend = strtolower($fileend);

if ( $fileend == ".torrent" ) {

                 // If you want you could merge this into one echo
                 // The info button takes you to parse.php, which is the important part
                                echo "<A HREF=\"parse.php?filename=$file\">info:</A><A HREF=\"$dirpath/$file\">$file</A><BR>";


?> [/code]
Now i have 2 questions:
1. How do i make a search engine that will search the folder and display the closest matches?
2. Pagin that will only display 40 results per page!

Share this post

Link to post
Share on other sites


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.