📄 registpage.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'registPage.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script language="javascript">
function check(){
var userName = document.forms[0].userName.value;
var password = document.forms[0].password.value;
var ensurePwd = document.forms[0].ensurePwd.value;
var length = userName.length;
var length1 = password.length;
var length2 = ensurePwd.length;
if(length<=0){
alert("用户名不能为空!");
}else if(length>20){
alert("用户名过长!");
}else if(length1<=0){
alert("密码不能为空!");
}else if(length1>20){
alert("密码过长!请缩短密码长度!");
}else if(length2<=0){
alert("请输入确认密码");
}else if(password!=ensurePwd){
alert("两次输入的密码不一致!");
}else {
document.forms[0].submit();
}
}
</script>
</head>
<body bgcolor="D9EAFC">
<p align="center">
<font size=7 color="0000ee">欢迎您进入注册页面</font>
</p>
<hr>
<form action="servlet/UserServlet" method="post">
<input type="hidden" name="action" value="regist"/>
<br>
<p align="center">
*标注的项为必需填写
</p>
<table align="center">
<tr>
<td>
<font color="ff0000">*</font>用户名:
</td>
<td>
<input type="text" name="userName">
</td>
</tr>
<tr>
<td>
</td>
<td>
<font color="ff0000"></font>
</td>
</tr>
<tr>
<td>
<font color="ff0000">*</font>密 码:
</td>
<td>
<input type="password" name="password">
</td>
</tr>
<tr>
<td>
<font color="ff0000">*</font>确 认:
</td>
<td>
<input type="password" name="ensurePwd">
<font color="ff0000">请再输入一次密码</font>
</td>
</tr>
<tr>
<td>
联系电话:
</td>
<td>
<input type="text" name="phone">
</td>
</tr>
<tr>
<td>
住址:
</td>
<td>
<input type="text" name="address">
请填写您的住址
</td>
<td>
</td>
</tr>
<tr>
<td>
<input type="button" value=" 注 册 " onclick="return check()">
</td>
<td> <input type="reset" value=" 重 置 ">
</td>
<tr><td colspan="2">
<%
String errorInfo = request.getParameter("errInfo");
String id = request.getParameter("id");
if(errorInfo!=null&&errorInfo.equals("null_error")){
out.print("<br><font color=red>注册成功,您的登录号是: "+id+"</font><br><br>");
}
%>
</td>
</tr>
<td colspan="2"> <input type="button" value="返回首页"
onclick="window.location.href='headpage.jsp'">
</td>
</table>
</form>
<p align="center">
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -