프로젝트/첫번째 jsp eclipes html 을 활용한..
회원수정 admin - member -list.jsp
IT새내기IM
2023. 1. 31. 10:12
넘버링 추가, 검색어 추가 전 list.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<%@ include file="/admin/include/header.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String code = request.getParameter("code");
String sql = "select * from "+code+"";
Connection con = DriverManager.getConnection(url, user, password);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);
String memberid = "";
String pass = "";
String name = "";
String email1 = "";
String email2 = "";
String level = "";
String zipcode = "";
String zipcode1 = "";
String zipcode2 = "";
String zipcode3 = "";
String zipcode4 = "";
String phone1 = "";
String phone2 = "";
String phone3 = "";
String birth_01 = "";
String birth_02 = "";
String birth_03 = "";
String gender="";
%>
<table width=1900 align=center border=1>
<tr>
<td width="50">No</td>
<td width="125">아이디</td>
<td width="125">비밀번호</td>
<td width="100">이름</td>
<td width="150">이메일</td>
<td width="50">레벨</td>
<td width="850">주소</td>
<td width="200">폰번호</td>
<td width="200">생년원일</td>
<td width="50">성별</td>
</tr>
<%while(rs.next()){
memberid = rs.getString("memberid");
pass = rs.getString("password");
name = rs.getString("name");
email1 = rs.getString("email1");
email2 = rs.getString("email2");
level = rs.getString("level");
zipcode = rs.getString("zipcode");
zipcode1 = rs.getString("zipcode1");
zipcode2 = rs.getString("zipcode2");
zipcode3 = rs.getString("zipcode3");
zipcode4 = rs.getString("zipcode4");
phone1 = rs.getString("phone1");
phone2 = rs.getString("phone2");
phone3 = rs.getString("phone3");
birth_01 = rs.getString("birth_01");
birth_02 = rs.getString("birth_02");
birth_03 = rs.getString("birth_03");
gender= rs.getString("gender");
%>
<tr>
<td width="50">No</td>
<td width="125"><%=memberid%></td>
<td width="125"><%=pass%></td>
<td width="100"><%=name%></td>
<td width="150"><%=email1%></td>
<td width="50"><%=level%></td>
<td width="850"><%=zipcode%> / <%=zipcode1%> / <%=zipcode2%> / <%=zipcode3%> / <%=zipcode4%></td>
<td width="200"><%=phone1%> - <%=phone2%> - <%=phone3%></td>
<td width="200"><%=birth_01%>년 <%=birth_02%>월 <%=birth_03%>일</td>
<td width="50"><%=gender%></td>
</tr>
<%
}
rs.close();
stmt.close();
con.close();
// if(total_record == 0){
// out.print("<tr><td colspan=5 algin=center height=100>작성하신글이없습니다.</td></tr>");
// }
%>
</table>
</body>
</html>