member/update.jsp
페이지 정보
작성자 관리자 작성일 23-03-13 19:00 조회 352 댓글 0본문
<%@ 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+"', email = '"+email+"' where m_id = '"+session_id+"' ";
}else{ //비밀번호 변경시
sql="update member set m_name = '"+name+"', 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("/");
%>
댓글목록 0
등록된 댓글이 없습니다.