-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogout.jsp
More file actions
65 lines (62 loc) · 1.8 KB
/
logout.jsp
File metadata and controls
65 lines (62 loc) · 1.8 KB
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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>FeedBack Management System</title>
<link rel="stylesheet" href="mystyle.css"/>
<style>
body {
background-color: #f5f5f5;
font-family: Arial, sans-serif;
}
.center {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
gap: 45px;
}
input[type="submit"] {
background-color: #007bff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
input[type="submit"]:hover {
background-color: #0056b3;
}
</style>
<script>
function confirmLogout() {
return confirm("Are you sure you want to log out?");
}
</script>
</head>
<body>
<center>
<%
String un = (String) session.getAttribute("un");
if (un == null) {
response.sendRedirect("index.jsp");
}
%>
<form method="POST" onsubmit="return validateForm()" class="center">
<input type="submit" value="Logout" name="logout" onclick="return confirmLogout()">
<input type="submit" value="Back" name="back">
</form>
<%
if (request.getParameter("logout") != null) {
session.invalidate();
response.sendRedirect("index.jsp");
return;
} else if (request.getParameter("back") != null) {
response.sendRedirect("home.jsp");
return;
}
%>
</center>
</body>
</html>