-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtakefilesearch.php
More file actions
36 lines (24 loc) · 890 Bytes
/
takefilesearch.php
File metadata and controls
36 lines (24 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
ob_start("ob_gzhandler");
require_once("include/bittorrent.php");
require_once "include/user_functions.php";
//require_once "include/torrenttable_functions.php";
//require_once "include/pager_functions.php";
dbconn(false);
loggedinorreturn();
if(isset($_POST["search"]) && !empty($_POST['search'])) {
$cleansearchstr = sqlesc(searchfield($_POST['search']));
print $cleansearchstr;
}
else
stderr("Opps", "Nuffin 'ere!");
$query = mysql_query("SELECT id, filename, MATCH (filename)
AGAINST (".$cleansearchstr.") AS score
FROM files WHERE MATCH (filename)
AGAINST (".$cleansearchstr." IN BOOLEAN MODE)");
if(mysql_num_rows($query) == 0)
stderr("Error", "Nothing found");
while($row = mysql_fetch_assoc($query)) {
print '<pre>'.$row['id']."-".htmlspecialchars($row['filename'])."-".$row['score'].'</pre>';
}
?>