-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brianna
authored and
Brianna
committed
Mar 23, 2017
1 parent
11fe650
commit 316f9ad
Showing
4 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<%@ page import = "database.MySQLAccess" %> | ||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" | ||
pageEncoding="ISO-8859-1"%> | ||
<%@ page import = "java.sql.*" %> | ||
<% | ||
int ssoNum; | ||
String pass; | ||
Cookie adminCookie; | ||
ssoNum = Integer.parseInt(request.getParameter("ssoNum2")); | ||
pass = request.getParameter("pass"); | ||
MySQLAccess myaccess = new MySQLAccess(); | ||
Statement statement = myaccess.connectDB(); | ||
ResultSet result; | ||
result = statement.executeQuery("select * FROM admin where Admin_ID='" + ssoNum + "' AND Password='" + pass + "'"); | ||
if (result.next()){ | ||
request.getSession(); | ||
session.setAttribute("ssoNum", ssoNum); | ||
adminCookie = new Cookie("ssoNum", Integer.toString(ssoNum)); | ||
adminCookie.setMaxAge(30*60); | ||
response.addCookie(adminCookie); | ||
response.sendRedirect("html/webpages/admin.html"); | ||
} else { | ||
response.sendRedirect("index.jsp"); | ||
} | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<%@ page import = "database.MySQLAccess" %> | ||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" | ||
pageEncoding="ISO-8859-1"%> | ||
<%@ page import = "java.sql.*" %> | ||
<% | ||
int ssoNum; | ||
Cookie userCookie; | ||
ssoNum = Integer.parseInt(request.getParameter("ssoNum")); | ||
MySQLAccess myaccess = new MySQLAccess(); | ||
Statement statement = myaccess.connectDB(); | ||
ResultSet result; | ||
result = statement.executeQuery("select * FROM employee where Employee_ID='" + ssoNum + "'"); | ||
if (result.next()){ | ||
request.getSession(); | ||
session.setAttribute("ssoNum", ssoNum); | ||
userCookie = new Cookie("ssoNum", Integer.toString(ssoNum)); | ||
userCookie.setMaxAge(30*60); | ||
response.addCookie(userCookie); | ||
response.sendRedirect("html/webpages/index.html"); | ||
} else { | ||
response.sendRedirect("index.jsp"); | ||
} | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters