📄 reg_success.jsp
字号:
<%@page contentType="text/html" pageEncoding="utf-8"%>
<%@ page import="ArticleSharing.DBTools,myTools.TimeMaker" %>
<%@ page import="java.sql.*" %>
<%!
String user_name = null;
int is = 1;
%>
<%
String errMessage = "";
String action = request.getParameter("action");
if (action != null)
if (action.equals("submit")) {
int user_id = 0;
DBTools tool = new DBTools();
TimeMaker make = new TimeMaker();
String create_time = make.getTime();
user_name = request.getParameter("user_name");
String password = request.getParameter("password");
int bir_year = Integer.parseInt(request.getParameter("bir_year"));
int bir_month = Integer.parseInt(request.getParameter("bir_month"));
int bir_day = Integer.parseInt(request.getParameter("bir_day"));
String job = DBTools.changeCharset(request.getParameter("job"),"ISO-8859-1", "utf-8");
String email = request.getParameter("email");
String sex = request.getParameter("sex");
String photo_path = "";
String role = "member";
int visitor_count = 0;
String self_description = DBTools.changeCharset(request.getParameter("self_description"),"ISO-8859-1", "utf-8");
String user_sql = "insert into users(user_name,password,email,photo_path,bir_year,bir_month,bir_day,job,sex,self_description,role,visitor_count,create_time)values('" + user_name + "','" + password + "','" +
email + "','" + photo_path + "'," + bir_year + "," + bir_month + "," + bir_day + ",'" + job + "'," + sex + ",'" + self_description + "','" + role + "'," + visitor_count + ",'" + create_time + "')";
if(tool.excuteUpdate(user_sql) == 0)
is = 0;
//title = DBTools.changeCharset(title, "ISO-8859-1", "utf-8");
ResultSet rs = tool.excuteQuery("select max(user_id) from users");
if (rs.next()) {
user_id = rs.getInt("max(user_id)");
}
session.setAttribute("image_id",String.valueOf(user_id));
session.setAttribute("user_id", String.valueOf(user_id));
//System.out.println(max_id);
String realname = DBTools.changeCharset(request.getParameter("realname"),"ISO-8859-1", "utf-8");
String province = DBTools.changeCharset(request.getParameter("province"),"ISO-8859-1", "utf-8");
String city = DBTools.changeCharset(request.getParameter("city"),"ISO-8859-1", "utf-8");
String education = DBTools.changeCharset(request.getParameter("education"),"ISO-8859-1", "utf-8");
String telephone = request.getParameter("telephone");
String cellphone = request.getParameter("cellphone");
String QQ = request.getParameter("QQ");
String blood_type =request.getParameter("blood_type");
String constellation = DBTools.changeCharset(request.getParameter("constellation"),"ISO-8859-1", "utf-8");
int marriage = Integer.parseInt(request.getParameter("marriage"));
String iden_sql = "insert into identity_information(user_id,realname,province,city,education,telephone,cellphone,qq,blood_type,constellation,marriage)values("
+ user_id + ",'" + realname + "','" + province + "','" + city + "','" + education + "','"+telephone
+"','"+cellphone + "','" + QQ + "','" + blood_type + "','" + constellation + "'," + marriage + ")";
if(tool.excuteUpdate(iden_sql) == 0)
is = 0;
}
else
is = 0;
if(is == 0)
response.sendRedirect("err.jsp");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>注册成功页面</title>
<style type="text/css">
<!--
.STYLE1 {
color: #FF0000;
font-weight: bold;
font-size: large;
}
body {
background-image: url(bdb9184ff956b920aec3abfe.jpg);
}
-->
</style>
</head>
<body>
<h2 align="center" class="STYLE1">恭喜你,注册成功!您的账号是:</h2>
<p align="center"><font color = "blue"><%=user_name%></font></p>
<p><a href="upload.html"><strong>上传靓照</strong></a>(上传您的靓照可以增加您个人空间的吸引力和增强你资料的真实性,强烈建议上传真实相片,秀出真我风采)</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -