member/update.jsp
페이지 정보
본문
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/header.jsp" %>
<%
request.setCharacterEncoding("utf-8"); //한글 깨짐 방지
String id = request.getParameter("mb_id");
String passwd = request.getParameter("mb_password");
String name = request.getParameter("mb_name");
String email = request.getParameter("mb_email");
String sql;
if(passwd == ""){ //비밀번호 미입력
sql="update member set m_name = '"+name+"', m_email = '"+email+"' where m_id = '"+session_id+"' ";
}else{ //비밀번호 변경시
sql="update member set m_name = '"+name+"', m_email = '"+email+"', m_pass = '"+passwd+"' where m_id = '"+session_id+"' ";
}
Connection conn = DriverManager.getConnection(url, user, password);
Statement stmt = conn.createStatement();
stmt.executeUpdate(sql);
stmt.close();
conn.close();
response.sendRedirect("/");
%>
- 이전글member/modify.jsp 23.04.25
- 다음글▣ include/dbconnection.jsp ( 수정 ) 23.04.25
댓글목록
등록된 댓글이 없습니다.