-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.jsp
52 lines (49 loc) · 1.42 KB
/
search.jsp
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
<!DOCTYPE html>
<html>
<head>
<title>Search</title>
</head>
<div style="float: right">
<form name="logout" method="post" action="logout.jsp">
<input type="submit" name="logout" value="logout">
</form>
<form name="logout" method="post" action="menu.jsp">
<input type="submit" name="menu" value="menu">
</form>
<form name=help method=get action=help.html>
<input type=submit name=help value=help>
</form>
</div>
<body>
<%
String userName=(String)session.getAttribute("USERNAME");
if (userName==null){
response.sendRedirect("login.jsp");
}
%>
<h1>Search</h1>
<form name = "sResult" method="post" action="searchResult.jsp">
By keywords: <input name = "searchKey" type="text" placeholder="Search..."></input> <br>
<hr>
Find posts by date:<br>
from: <input name="searchFromTime" placeholder ="DD/MM/YYYY" type="text" size="30"></input> <br>
to: <input name="searchToTime" placeholder ="DD/MM/YYYY"type="text" size="30"></input><br><br>
Sort by:<br>
<select name='sort'>
<option value="none">None</option>
<option value="desc">Descending</option>
<option value="ascen">Ascending</option>
</select>
<br>
<br>
<input type = "submit" name ="searchData" value="Search">
</form>
</body>
<%
String error = (String) session.getAttribute("error");
if (error != null) {
out.println(error);
session.removeAttribute("error");
}
%>
</html>