member_info.jsp
페이지 정보
작성자 관리자 작성일 21-07-15 19:43 조회 432 댓글 0본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%
if ((session.getAttribute("id")==null) ||
(!((String)session.getAttribute("id")).equals("admin"))) {
out.println("<script>");
out.println("location.href='loginForm.jsp'");
out.println("</script>");
}
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/test?serverTimezone=UTC";
String user="root";
String password="1111";
Connection conn=null;
PreparedStatement pstmt=null;
ResultSet rs=null;
String info_id=request.getParameter("id");
try {
conn=DriverManager.getConnection(url, user, password);
pstmt=conn.prepareStatement("SELECT * FROM member2 WHERE id=?");
pstmt.setString(1,info_id);
rs=pstmt.executeQuery();
rs.next();
}catch(Exception e){
e.printStackTrace();
}
%>
<html>
<head>
<title>회원관리 시스템 관리자모드(회원 정보 보기)</title>
<style>
table{
margin : auto;
width : 400px;
border : 1px solid gray;
text-align: center;
}
</style>
</head>
<body>
<table>
<tr>
<td>아이디 : </td>
<td><%=rs.getString("id") %></td>
</tr>
<tr>
<td>비밀번호 : </td>
<td><%=rs.getString("password") %></td>
</tr>
<tr>
<td>이름 : </td>
<td><%=rs.getString("name") %></td>
</tr>
<tr>
<td>나이 : </td><td><%=rs.getString("age") %></td>
</tr>
<tr>
<td>성별 : </td><td><%=rs.getString("gender") %></td>
</tr>
<tr>
<td>이메일 주소 : </td>
<td><%=rs.getString("email") %></td>
</tr>
<tr>
<td colspan=2><a href="member_list.jsp">리스트로 돌아가기</a></td>
</tr>
</table>
<%
rs.close();
pstmt.close();
conn.close();
%>
</body>
</html>
댓글목록 0
등록된 댓글이 없습니다.