-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
executable file
·65 lines (46 loc) · 1.82 KB
/
search.php
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<table cellspacing="2" cellpadding="0" align="center" border="0" width="99%">
<tr>
<td>
<?
// check the search string is over strlen(3) and not padded with spaces
$searchstr = $_REQUEST['search'];
$errstr = "<font color=\"red\">Error in search string. Try again.</font><br />";
if(!check_empty($searchstr)) {
if(strlen($searchstr) <= 2) {
print $errstr;
} elseif (strlen($searchstr) == 3 && stristr($searchstr, " ")) {
print $errstr;
} else {
include("getquote.php");
}
} else {
print "<h1>Search 'em</h1>";
}
?>
<br />
<center>
Search tip: Ensure your keyword is over 3 letters long.<br />
<br />
<form action="./?search" method="get">
Enter your search phrase:<br /><br />
<input type="text" name="search" maxlength="30" value="<?=$searchstr ?>">
<input type="submit" value="Search"><br /><br />
Number to get:
<select name="lim">
<option value="25" selected>25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="100">100</option>
</select>
<br />
<br />
Sort by:
<select name="sb">
<option value="0" selected>Quote Number</option>
<option value="1">Quote Score</option>
</select>
</form>
</center>
</td>
</tr>
</table>