📄 register.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../include/functionjs.asp"-->
<!--#include file="../include/functionvb.asp" -->
<!--#include file="../include/md5.asp" -->
<!--#include file="../include/dbconn.inc" -->
<!--#include file="../include/refresh.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>56blog注册</title>
<link href="../include/main.css" rel="stylesheet" type="text/css">
<link href="../include/css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #CCCCCC}
-->
</style>
</head>
<body>
<div id="Layer1" style="position:absolute; width:794px; height:448px; z-index:1; left: 150px; top: 52px; background-color: #212021; layer-background-color: #212021; border: 1px none #000000;">
<div id="Layer2" style="position:absolute; width:228px; height:361px; z-index:1; left: 27px; top: 52px;">
<%
if request.QueryString("action")="register" then
dim reg_title,reg_msg
dim username,userpsw1,userpsw2,usersex,useremail,userface
username=trim(request.form("name"))
userpsw1=trim(request.form("psw1"))
userpsw2=trim(request.form("psw2"))
usersex=request.form("sex")
useremail=trim(request.form("email"))
userface=trim(request.form("face"))
if username=empty or userpsw1=empty or userpsw2=empty then
reg_title="<span class=style2>错误信息</span>"
reg_msg="<span class=style2>请将注册信息填写完整</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
elseif datediff("s",session("LastRegTime"),now())<60 then
reg_title="<span class=style2>错误信息</span>"
reg_msg="<span class=style2>两次注册之间间隔至少为一分钟</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
session("LastRegTime")=now()
else
if userpsw1<>userpsw2 then
reg_title="<span class=style2>错误信息</span>"
reg_msg="<span class=style2>密码与确认密码不同</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
elseif Len(userpsw1)<6 or Len(userpsw1)>16 Then
reg_title="<span class=style2>错误信息</span>"
reg_msg="<span class=style2>密码长度不符合,请输入6-16位密码</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
'elseif Len(username)>24 Then
'reg_title="错误信息"
'reg_msg="用户名长度超过24个字符,12个汉字"
elseif Not IsValidUserName(username) Then
reg_title="<span class=style2>错误信息</span>"
reg_msg="<span class=style2>用户名中含有非法字符</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
elseif IsValidEmail(Request.Form("Email"))=False and Trim(Request.Form("Email"))<>Empty Then
reg_title="<span class=style2>错误信息</span>"
reg_msg="<span class=style2>电子信箱输入错误. 如果你不想输入请留空.</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
else
strsql="select * from user_info where user_name='"& username &"'"
objrs.open strsql,objConn,1,1
if not objrs.eof then
reg_title="<span class=style2>错误信息</span>"
reg_msg="<span class=style2>对不起,你所使用的用户名已经注册</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
else
objrs.close
strsql="insert into user_info(user_Name,user_Psw,user_Sex,user_Email,user_RegTime,user_LastVisTime,User_LastVisTimeTemp,user_IP,user_face,user_logincount,user_facewidth,user_faceheight,user_isonline,bbs_pubcount,blog_pubcount,commendcount) values ('" & username & "','" & md5(userpsw1) &"'" &",'"& usersex &"','"& useremail &"','"& Now() &"','"& Now() &"','"& Now() &"','"&request.ServerVariables("REMOTE_ADDR")&"','"& userface &"',"& 1&","& 120&","& 120&","& 1&","& 0&","& 0&","& 0&")"
objrs.open strsql,objConn,1,1
'objrs.close
strSQL="select user_id from user_info where user_name='"& username&"'"
objrs.open strsql,objconn,1,1
dim userid
userid=objRS("user_Id")
Response.Cookies("UserInfo")("userId")=userid
Response.Cookies("UserInfo")("userName")=username
objrs.close
strSQL="select * from webcount"
objrs.open strsql,objconn,1,3
objrs("User_TtlCnt")=objrs("User_ttlCnt")+1
objrs("User_TdyCnt")=objrs("User_tdyCnt")+1
objrs("Vis_TtlCnt")=objrs("Vis_TtlCnt")+1
objrs("Vis_TdyCnt")=objrs("Vis_TdyCnt")+1
objrs("Last_RegUserId")=userid
objrs("Last_RegUsername")=username
objrs("Last_visUserId")=userid
objrs("Last_visUsername")=username
objrs("Last_vistime")=now()
objrs.update
objrs.close
reg_title="<span class=style2>注册成功</span>"
reg_msg="<span class=style2>欢迎你来到56blog,请返回首页,登录后可修改具体信息<br>3秒后浏览器将自动跳转,<br> <br><a href='../blog/main.asp'>如无跳转请手动点击这里<meta http-equiv='refresh' content=3;url='../blog/main.asp'></span>"
'图片处理---未做!
%>
<!--#include file ="../include/endconn.inc"-->
<%
end if
end if
end if
response.Write(reg_title & "<br>" & reg_msg)
else%>
<form name="register" method="post" action="register.asp?action=register" title="*选项为必填选项" onSubmit="return checkin(this)">
<pre><span class="style2">用户名* </span> <input name="name" type="text" id="name" size=17 title="用户名不能超过24个字符,12个汉字" maxlength="24"></pre>
<pre><span class="style2">密码* </span> <input name="psw1" type="password" id="psw1"size=18 title="密码必须是6-16位,密码上传已经加密,请放心" maxlength="16"></pre>
<pre><span class="style2">确认密码*</span> <input name="psw2" type="password" id="psw2"size=18 title="密码必须是6-16位,密码上传已经加密,请放心" maxlength="16"></pre>
<hr>
<pre><span class="style2">性别* </span> <label><span class="style2"><input type="radio" id="sex"name="sex" value="男" checked=1>男</span></label><span class="style2"><label></label></span><label> <input type="radio" name="Sex" value="女"><span class="style2">女</span></label></pre>
<pre><span class="style2">Email </span> <input name="email" type="text"id="email" size=18></pre>
<pre><span class="style2">头像</span> <select name="face" onChange="chgface">
<%
dim i
for i=1 to 60%>
<option value="<%=i%>">image<%=i%>
<%next%>
</select>
</pre>
<pre> <input type="submit" name="Submit" class="input" value="注册" title="登录后可修改具体信息"> <input type="reset" name="reset" class="input" value="清除"></pre>
</form>
<script language="vbscript">
Function checkin(myform)
checkin=true
if (trim(myform.name.value)="") then
msgbox ("请填写用户名!")
checkin= false
exit function
end if
if (trim(myform.psw1.value)="") then
msgbox ("请填写密码!")
checkin= false
exit function
end if
if (trim(myform.psw2.value)="") then
msgbox ("请填写确认密码!")
checkin= false
exit function
end if
if not trim(myform.newpsw1.value)=trim(myform.newpsw2.value) then
msgbox ("密码与确认密码不一致,请重新输入!")
checkin= false
exit function
end if
</script>
<%end if%>
</div>
<div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:2; left: 288px; top: 50px;"><img src="../resource/images/yellow.jpg" width="481" height="360"></div>
<map name="Map">
<area shape="rect" coords="8,4,26,13" title="回到主页" href="../blog/main.asp">
<area shape="rect" coords="38,4,45,12"title="回到前一页" href="javascript:history.go(-1)">
</map>
<img src="../resource/images/back.gif" width="59" height="17" border="0" usemap="#Map" align="top">
<span class="style2">登录网站后请到“修改信息”处修改详细信息</span></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -