📄 userlogin.jsp~12~
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page session="true" %>
<%@ page contentType="text/html; charset=GB2312" %>
<%@ page errorPage="login_error.jsp" %>
<jsp:useBean id="dbconnbean" scope="page" class="bookmanager.dbconnBean" />
<jsp:useBean id="bookuserbean" scope="page" class="bookmanager.bookuserBean" />
<jsp:setProperty name="bookuserbean" property="*" />
<%
String sql;
String submit = request.getParameter("Submit");
if (submit!=null && !submit.equals("")) {
String username=bookuserbean.getUsername();
sql="INSERT INTO bookuser ( username, password, name, sex, email, phone, address, bclass, regtime, regip) VALUES( "
+"'"+bookuserbean.getUsername()+"' ,"
+"'"+bookuserbean.getPassword()+"' ,"
+"'"+bookuserbean.getName()+"' ,"
+"'"+bookuserbean.getSex()+"' ,"
+"'"+bookuserbean.getEmail()+"' ,"
+"'"+bookuserbean.getPhone()+"' ,"
+"'"+bookuserbean.getAddress()+"' ,"
+"'"+bookuserbean.getBclass()+"' ,"
+"getdate() ,"
+"'"+bookuserbean.getRegip()+"')";
boolean reg=dbconnbean.executeInsert(sql);
System.out.println(sql);
session.setAttribute("username",username);
out.print("<html><head><meta http-equiv=Content-Type content=text/html; charset=gb2312><title>无标题文档</title></head><body>");
if(reg==true){
out.print("注册成功!"+"<br>");
response.sendRedirect("welcome.jsp");
System.out.println(username);
}
else
out.print("用户名已存在!");
out.print("</body></html>");
}
%>
<script language="javascript">
function openScript(url,name, width, height){
var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
function checkform() {
if (document.form1.username.value==""){
alert("用户名不能为空");
document.form1.username.focus();
return false;
}
if (document.form1.passwd.value==""){
alert("用户密码不能为空");
document.form1.passwd.focus();
return false;
}
if (document.form1.passwd.value!=document.form1.passconfirm.value){
alert("确认密码不相符!");
document.form1.passconfirm.focus();
return false;
}
return true;
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户注册</title>
<style type="text/css">
<!--
@import url("images/s.css");
-->
</style>
<style type="text/css">
<!--
.style1 {
color: #9900FF;
font-weight: bold;
font-size: 18px;
}
.style2 {color: #00FF00;
font-weight: bold;
}
body,td,th {
font-family: 长城行楷体;
font-size: 20px;
color: #999933;
}
.style3 {
color: #CC6633;
font-weight: bold;
font-size: 24px;
}
.style5 {
color: #9966FF;
font-weight: bold;
font-size: 18px;
}
a:link {
color: #0033FF;
}
a:visited {
color: #0066FF;
}
a:active {
color: #00CC00;
}
.style8 {color: #00FF00; font-weight: bold; font-size: 18px; }
.style9 {font-size: 18px}
.style11 {font-family: "长城行楷体"; color: #99CC33; }
.style12 {font-size: 15px}
.style14 {font-size: 15px; color: #99CC33; }
.style16 {font-size: 9px}
.style19 {font-size: 9px; color: #9999CC; }
-->
</style>
</head>
<body>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" background="images/0002.gif">
<tr>
<td height="100" colspan="5"><p><img src="images/head.gif" width="707" height="100"></p></td>
</tr>
<tr align="center" valign="middle">
<td width="700" height="22" class="style2"><img src="images/009.gif" width="28" height="22"><a href="index.jsp" class="style5">首页</a></td>
<td width="700" height="22"><img src="images/009.gif" width="28" height="22"><span class="style1"><a href="introduction.jsp" class="style2">系统简介</a></span></td>
<td width="700" height="22"><img src="images/009.gif" width="28" height="22"><a href="userlogin.jsp" class="style8">用户注册</a></td>
<td width="700" height="22"><img src="images/009.gif" width="28" height="22"><strong class="style2"><a href="managerindex.jsp" class="style9">管理员入口</a></strong></td>
<td width="700" height="22"><img src="images/009.gif" width="28" height="22"><strong><a href="logout.jsp" class="style9">退出系统</a></strong></td>
</tr>
<tr>
<td colspan="5"><hr size="2"></td>
</tr>
<tr>
<td colspan="5"><form name="form1" method="post" action="userlogin.jsp">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3" align="center" valign="middle"><span class="style3">用户注册</span></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td colspan="3" align="center" valign="middle"> </td>
</tr>
<tr>
<td width="216" height="15"> 用户名</td>
<td height="15" colspan="2"><p>
<input name="username" type="text" id="username" size="30">
<span class="style11">*<span class="style12">数字字母组成</span></span></p>
</td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td width="216" height="15"> 密码</td>
<td height="15" colspan="2"><p>
<input name="password" type="password" id="password" size="30">
<span class="style11">*<span class="style12">数字字母组成</span></span></p>
</td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td width="216" height="15"> 密码确认</td>
<td height="15" colspan="2"><p>
<input name="confirm" type="password" id="confirm" size="30">
<span class="style11"> *<span class="style12">数字字母组成</span></span></p>
</td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="15"> 真实姓名</td>
<td height="15" colspan="2"><input name="name" type="text" id="name" size="30">
<span class="style14">*真实姓名</span></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="15"> 性别</td>
<td width="115" height="15"> 男
<input name="sex" type="radio" value="男" checked></td>
<td width="269" height="15">女
<input name="sex" type="radio" value="女">
<span class="style14">*请如实填写</span> </td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="15"> E-mail</td>
<td height="15" colspan="2"><input name="email" type="text" id="email" size="30.">
<span class="style14">*电子邮件</span></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="15"> 电话</td>
<td height="15" colspan="2"><input name="phone" type="text" id="phone" size="30"></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="15"> 住址</td>
<td height="15" colspan="2"><input name="address" type="text" id="address" size="50"></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style19">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="15"> 学科</td>
<td height="15" colspan="2"><select name="bclass" >
<option selected>计算机</option>
<option >数学</option>
<option >物理</option>
<option >土木工程</option>
<option >信息安全</option>
<option >其他</option>
</select></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style16">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="20" colspan="3">
<input type="submit" name="Submit" value="注册" onclick="javascript:return(checkform());">
<input type="reset" name="Submit" value="重置"></td>
</tr>
<tr>
<td height="1" colspan="3"><span class="style16">------------------------------------------------------------------------------------------------------------------------</span></td>
</tr>
<tr>
<td height="20" colspan="3"> </td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -