Jump to content

Paging and searching


lancey10

Recommended Posts

ok so i have a script that displays all files in a folder!
here it is:
[code]<?
           $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>";
                                           }

}
    }
     closedir($dh);


?> [/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!
Link to comment
https://forums.phpfreaks.com/topic/5560-paging-and-searching/
Share on other sites

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.