📄 reg.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.text.*" errorPage="err.jsp?msg=对不起,没有找到您需要的资源" %>
<%@ include file="conn.jsp"%>
<%request.setCharacterEncoding("gb2312");
String action="save";
String User=request.getParameter("user");
String pwd=request.getParameter("pwd1");
String repwd=request.getParameter("pwd2");
String sex=request.getParameter("sex");
String email=request.getParameter("email");
//out.print(request.getParameter("type")+"dd");
if (action.equals(request.getParameter("type"))){
if((User.length())*(pwd.length())*(repwd.length())*(email.length())==0){
out.print("<script>alert('请确定在带‘*’的文本框中输入数据!');history.go(-1);</script>");
}else{
if(pwd.equals(repwd)){
String sql1="select * from [user] where [user]='"+User.trim()+"'";
ResultSet rs1=stmt.executeQuery(sql1);
//out.print(sql1);
if(rs1.next()){
rs1.close();
out.print("<script>alert('该用户名已经被注册,请选择其它的用户名!');history.go(-1);</script>");
}else{
String sql="Insert into [user]([user],pwd,sex,OICQ,email) Values('"+User.trim()+"','"+pwd.trim()+"','"+sex+"','"+request.getParameter("oicq").trim()+"','"+email.trim()+"')";
stmt.executeUpdate(sql);
out.print("<script>alert('恭喜您,注册成功!');window.location.href='index.jsp';</script>");
Cookie comqing=new Cookie("IsMem","true");
response.addCookie(comqing);
//out.print(User);
}
//response.
}else{
out.print("您两次输入的密码不一致,请确定一致后再按提交!");
}
}
stmt.close();
conn.close();
//out.print(" 恭喜您,注册成功!");
}else{
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>会员注册 - 同庆源码站 >>> 为广大站长提供最新最全的精品资讯!</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=Content-Language content=zh-cn>
<META
content=站长,站长资源,飞狐,im63,fihu.net,asp源码,cgi源码,php源码,jsp源码,.net源码,网站素材,网页素材,网页模板,韩国模板,欧美模板,商业模板,免费模板,常用软件,注册版,破解版,免费LOGO,娱乐,flash动画,网络编程,网络学院,站长资源,网站联盟,精品网址,图片,壁纸,桌面,书籍教程,asp编程,cgi编程,php编程,平面设计,多媒体设计,服务器架设,服务器软件,电子图书,LOGO模板,PNG源文件,PSD源文件,精品字体,字体下载,软件下载
name=keywords><LINK href="images/style.css"
rel=stylesheet>
<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY>
<CENTER>
<SCRIPT language=javascript
src="images/head.js"></SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width=770 bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD width=770 height=4></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=770 border=0>
<TBODY>
<TR>
<TD width=768 bgColor=#dddddd colSpan=2 height=1></TD></TR>
<TR>
<TD width=650 bgColor=#eeeeee height=24> 您的位置:<A
href="index.jsp">下载首页</A> >> 会员注册</TD>
<TD align=middle width=120 bgColor=#eeeeee height=24><A
href="#"><FONT
color=#ff0000>为什么要注册帐号?</FONT></A></TD>
</TR>
<TR>
<TD width=768 bgColor=#dddddd colSpan=2 height=1></TD></TR></TBODY></TABLE>
<FORM action=reg.jsp method=post>
<INPUT type="hidden" value="save" name="type">
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=1 width=500 bgColor=#e6e6e6
border=0>
<TBODY>
<TR>
<TD width="100%" bgColor=#3faee4 height=24> <FONT
color=#ffffff><B>注册帐号</B></FONT></TD></TR>
<TR>
<TD width="100%" bgColor=#ffffff height=24> 用户名:<FONT color=#ff0000>
<input
style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
size=15 name=user>
*</FONT><FONT color=#808080>
不能有空格,只能有字母/数字或 - _</FONT></TD>
</TR>
<TR>
<TD width="100%" bgColor=#ffffff height=24> 登陆密码:<INPUT
style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
type=password size=15 name=pwd1> <FONT color=#ff0000>*</FONT><FONT
color=#808080> 同上</FONT></TD></TR>
<TR>
<TD width="100%" bgColor=#ffffff height=24> 确认密码:<INPUT
style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
type=password size=15 name=pwd2><FONT color=#808080> </FONT><FONT
color=#ff0000>*</FONT><FONT color=#808080> 同上</FONT></TD></TR>
<TR>
<TD width="100%" bgColor=#ffffff
height=24> 性 别:<SELECT size=1 name=sex>
<OPTION value=帅哥 selected>帅哥</OPTION> <OPTION
value=美女>美女</OPTION></SELECT></TD></TR>
<TR>
<TD width="100%" bgColor=#ffffff
height=24> OICQ:<INPUT
style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
size=15 name=oicq></TD></TR>
<TR>
<TD width="100%" bgColor=#ffffff height=24> E-Mail:<INPUT
style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
size=32 name=email> <FONT color=#ff0000>*</FONT></TD></TR>
<TR>
<TD width="100%" bgColor=#f7f7f7 height=24>
<P align=center><INPUT type=submit value=提交 name=b1> <INPUT type=reset value=清空 name=b2></P></TD></TR></TBODY></TABLE></FORM>
<SCRIPT language=javascript
src="images/foot.js"></SCRIPT>
</CENTER></BODY></HTML>
<%
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -