forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusermodify_deal.jsp
More file actions
38 lines (36 loc) · 1.64 KB
/
usermodify_deal.jsp
File metadata and controls
38 lines (36 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="connDB" scope="page" class="beans.connDB"/>
<jsp:useBean id="chStr" scope="page" class="beans.chStr"/>
<jsp:include page="safe.jsp"/>
<html>
<head>
<title>用户注册成功!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
String username=chStr.chStr(request.getParameter("UserName"));
if (username!=null && username.length()>0 ){
String truename=chStr.chStr(request.getParameter("TrueName"));
String PWD=chStr.chStr(request.getParameter("PWD2"));
String cardNO=chStr.chStr(request.getParameter("cardNO"));
String CardType=chStr.chStr(request.getParameter("CardType"));
String tel=chStr.chStr(request.getParameter("tel"));
String city=chStr.chStr(request.getParameter("city"));
String address=chStr.chStr(request.getParameter("address"));
String postcode=chStr.chStr(request.getParameter("postcode"));
String Email=chStr.chStr(request.getParameter("Email"));
int ret=0;
String sql="update tb_Member set Truename='"+truename+"',password='"+PWD+"',cardNO='"+cardNO+"',CardType='"+CardType+"',tel='"+tel+"',city='"+city+"',address='"+address+"',postcode='"+postcode+"',email='"+Email+"' where username='"+username+"'";
ret=connDB.executeUpdate(sql);
if(ret!=0){
out.println("<script language='javascript'>alert('资料修改成功!');window.location.href='index.jsp';</script>");
}else{
out.println("<script language='javascript'>alert('资料修改失败!');window.location.href='modify.jsp';</script>");
}
}else{
response.sendRedirect("index.jsp");
}
%>
</body>
</html>