📄 register_confirm.jsp
字号:
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册确认</title>
<style type="text/css">
<!--
.STYLE2 {color: #FFFF00}
.STYLE3 {color: #0000FF}
.STYLE4 {color: #00FF00}
body {
background-color: #000000;
}
-->
</style>
</head>
<body>
<div align="center">
<table width="726" border="0">
<tr>
<td width="720">
<%!
String name=new String().trim();
String pass=new String().trim();
String pass1=new String().trim();
String sex=new String().trim();
String birthday=new String().trim();
String mail=new String().trim();
String address=new String().trim();
String phone=new String().trim();
%>
<%
name=request.getParameter("name");
session.setAttribute("name",name);
pass=request.getParameter("pass");
session.setAttribute("pass",pass);
pass1=request.getParameter("pass1");
session.setAttribute("pass1",pass1);
sex=request.getParameter("sex");
if(sex.equals("m")){
sex="男";
}else
sex="女";
session.setAttribute("sex",sex);
birthday=request.getParameter("birthday");
session.setAttribute("birthday",birthday);
mail=request.getParameter("mail");
session.setAttribute("mail",mail);
address=request.getParameter("address");
session.setAttribute("address",address);
phone=request.getParameter("phone");
session.setAttribute("phone",phone);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:book");
Statement stmt=conn.createStatement();
String sql="select * from b_user where u_name='"+name+"'";
ResultSet rs=stmt.executeQuery(sql);
if(rs.next())
{
rs.close();
session.putValue("register_message","用户名已存在,请重新注册!");
%>
<jsp:forward page="register.jsp"/>
<% }
else
{
rs.close();
}
stmt.close();
conn.close();
}
catch(Exception e){}
%>
<form method="post" action="db.jsp">
<input type="hidden" name="name" value="<%=name%>" />
<input type="hidden" name="password" value="<%=pass%>" />
<input type="hidden" name="password" value="<%=pass1%>" />
<input type="hidden" name="password" value="<%=sex%>" />
<input type="hidden" name="password" value="<%=birthday%>" />
<input type="hidden" name="e_mail" value="<%=mail%>" />
<input type="hidden" name="address" value="<%=address%>" />
<input type="hidden" name="telephone" value="<%=phone%>" />
<span class="STYLE4">亲爱的<%=name%>,请检查您的注册信息</span><br />
<br />
<table width="60%" border="1">
<tr>
<td width="50%"><span class="STYLE2">您的帐号:</span></td>
<td width="50%"><span class="STYLE3"><%=name%></span></td>
</tr>
<tr>
<td height="25"><span class="STYLE2">您的密码:</span></td>
<td><span class="STYLE3"><%=pass%></span></td>
</tr>
<tr>
<td height="25"><span class="STYLE2">确认密码:</span></td>
<td><span class="STYLE3"><%=pass1%></span></td>
</tr>
<tr>
<td height="25"><span class="STYLE2">性别:</span></td>
<td><span class="STYLE3"><%=sex%></span></td>
</tr>
<tr>
<td><span class="STYLE2">邮箱地址</span></td>
<td><span class="STYLE3"><%=mail%></span></td>
</tr>
<tr>
<td><span class="STYLE2">您的地址:</span></td>
<td><span class="STYLE3"><%=address%></span></td>
</tr>
<tr>
<td><span class="STYLE2">联系方式</span></td>
<td><span class="STYLE3"><%=phone%></span></td>
</tr>
</table>
<div align="center">
<input type="submit" value="提交注册" />
<input type="button" value="返回修改" onclick="history.back()" />
</div>
</form></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -