Jump to content


Photo

Paging and searching


  • Please log in to reply
No replies to this topic

#1 lancey10

lancey10
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 23 March 2006 - 04:27 AM

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>";
                                           }

}
    }
     closedir($dh);


?>
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!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users