?? reg.jsp
字號:
<%@page contentType="text/html;charset=GBK"%>
<%
String submit = request.getParameter("submit");
if(submit!=null&&!"".equals(submit)){
blog.Op_user adduser = new blog.Op_user();
String msg = adduser.adduser(request);
if("ok".equalsIgnoreCase(msg)){
response.sendRedirect("showboard.jsp");
}
else{
response.sendRedirect("error.jsp?msg="+msg);
}
}
%>
<html>
<head>
<title>新用戶注冊</title>
<script language="javascript">
function checkform() {
if (document.form1.userName.value==""){
alert("用戶名不能為空");
document.form1.userName.focus();
return false;
}
if (document.form1.password.value==""){
alert("用戶密碼不能為空");
document.form1.password.focus();
return false;
}
if (document.form1.password.value!=document.form1.passconfirm.value){
alert("確認密碼不相符!");
document.form1.passconfirm.focus();
return false;
}
return true;
}
</script>
</head>
<body bgcolor="#DDDDFF">
<form name="form1" method="post" action="reg.jsp">
<table width="450" border="0" cellspacing="1" cellpadding="1" align=center>
<tr></tr>
<tr>
<td colspan="2" align="center"><b><font color="#0000FF">用戶注冊</font></b></td>
</tr>
<tr></tr>
<tr>
<td width="171" align="right">用戶名:</td>
<td width="272">
<input type="text" name="userName" maxlength="20" size="14" >
</td>
</tr>
<tr>
<td width="171" align="right">密碼:</td>
<td width="272">
<input type="password" name="password" maxlength="20" size="14">
</td>
</tr>
<tr>
<td width="171" align="right">確認密碼:</td>
<td width="272">
<input type="password" name="passconfirm" maxlength="20" size="14">
</td>
</tr>
<tr>
<td width="171" align="right">性別:</td>
<td width="272">
<select name="sex">
<option>男</option>
<option>女</option>
</select>
</td>
</tr>
<tr>
<td width="171" align="right">聯(lián)系電話:</td>
<td width="272">
<input type="text" name="phone" maxlength="25" size="14">
</td>
</tr>
<tr>
<td width="171" align="right">電子郵件:</td>
<td width="272">
<input type="text" name="email" maxlength="50" size="14">
</td>
</tr>
<tr>
<td width="171" align="right"> </td>
<td width="272">
<input type="submit" name="submit" value="submit" onclick="javascript:return(checkform());">
<input type="reset" name="reset" value="取消">
</td>
</tr>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -