-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoreg.jsp
More file actions
85 lines (73 loc) · 1.88 KB
/
doreg.jsp
File metadata and controls
85 lines (73 loc) · 1.88 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html style="overflow-Y:scroll;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<%
String userid=request.getParameter("e");
session.setAttribute("userid",userid);
String pwd=request.getParameter("p");
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/library","root","MYSQL");
Statement st= con.createStatement();
String msg,msg2,msg3;
ResultSet rs=st.executeQuery("select * from admin where id='"+userid+"'");
if(rs.next())
{
if(rs.getString(3).equals(pwd))
{
msg="welcome, "+rs.getString(2);
msg3="\nHow was your day";
msg2="Log Out";
}
else
{
msg="Invalid password try again";
msg2="Go Back";
msg3="check your password";
}
}
else
{
msg="Invalid UserId try again";
msg2="Go Back";
msg3="check your UserId address";
}
%>
<div class="form" >
<h1><%=msg%> <br><%=msg3%></h1>
<%if(msg2.equals("Log Out"))
{
%>
<br>
<form action="createAdmin.jsp">
<button type="submit" class="button" >Create Admin</button>
</form>
<br>
<form action="listmember.jsp">
<button type="submit" class="button">Memeber List</button>
</form><br>
<form action="book.jsp">
<button type="submit" class="button">Books list</button>
</form><br>
<form action="delete.jsp">
<button type="submit" class="button">Issue Book</button>
</form><br>
<%
}
else {
%>
<br><br><br><br><br><br><br><br>
<%}%>
<form action="log.jsp">
<button type="submit" class="button" ><%=msg2%></button>
</form>
</div>
</body>
</html>