-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
executable file
·29 lines (28 loc) · 1.02 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
<?php
require_once('config.php');
require_once('user.php');
require_once('font.php');
$loginPolicy = IsLogin();
if ($loginPolicy === null) {
RedirectLogin();
}
$minSearchLength = $loginPolicy[2]['MinSearchLength'];
$fontname = (isset($_POST['fontname']) ? $_POST['fontname'] : '');
$fontnameEscaped = htmlspecialchars($fontname, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5);
HTMLStart('Search', GetUserBar($loginPolicy[0], $loginPolicy[1], $loginPolicy[2]['AllowLogout']));
echo <<<html
<div class="searchBox">
<form role="serach" method="POST">
<label for="fontname">通过字体名搜索字体:</label>
<br>
<input type="text" id="fontname" name="fontname" minlength="{$minSearchLength}" value="{$fontnameEscaped}" />
<button type="submit">搜索</button>
</form>
</div>
html;
echo "\n";
if (!empty($fontname)) {
ShowTable(SearchFonts($minSearchLength, $loginPolicy[2]['MaxSearchFontCount'], $fontname), true, ($loginPolicy[2]['AllowDownloadFont'] ? [$loginPolicy[0], $loginPolicy[1], 0, time()] : null));
}
HTMLEnd();
?>