-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsms.jsp
More file actions
60 lines (58 loc) · 1.86 KB
/
sms.jsp
File metadata and controls
60 lines (58 loc) · 1.86 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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.io.*, java.sql.*" %>
<html>
<head>
<title>Student Management System</title>
<link rel="stylesheet" href="mystyle.css"/>
</head>
<body>
<center>
<h1>Student Management System 🗒️</h1>
<br>
<%--
The correct way to check if the "un" session attribute is not set is to use "session.getAttribute("un") == null".
--%>
<%
String un = (String) session.getAttribute("un");
if (un == null) {
response.sendRedirect("index.jsp");
} else {
out.println("Welcome " + un + "\uD83D\uDE03");
}
%>
<hr/>
<br><br>
<a href="add.jsp">
<button class="signup-button" type="submit" name="add">Add Student Record</button>
<br>
</a>
<br><br>
<a href="update.jsp">
<button class="signup-button" type="submit" name="update">Update Student Record</button>
<br>
</a>
<br><br>
<a href="view.jsp">
<button class="signup-button" type="submit" name="view">View Student Record</button>
<br>
</a>
<br><br>
<a href="delete.jsp">
<button class="signup-button" type="submit" name="delete">Delete Student Record</button>
<br>
</a>
<br><br>
<%-- The "onclick" event handler should be on the anchor tag, not on the button. --%>
<a href="index.jsp" onclick="return confirmLogout();">
<button class="signup-button" type="submit" name="logout">Logout</button>
<br>
</a>
<br><br>
</center>
<script>
function confirmLogout() {
return confirm("Are you sure you want to logout?");
}
</script>
</body>
</html>