📄 register.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin/md5.asp"-->
<%
response.Buffer = true
'****************************************************************
'* joinboard BBS Ver2.3.0/友盟论坛 Ver2.3.0
'*
'* 版权所有: JoinBoard V2.3
'*
'* 程序制作: 友盟工作室
'*
'* 主页地址: http://joinboard.com 友盟论坛
'*
'* 论坛地址: http://bbs.joinboard.com/、http://youmeng.com
'*
'****************************************************************
'* Powered by: JoinBoard V2.3
'* Copyright 2003-2004. - All Rights Reserved.
'* JoinBoard is a trademark of YouMeng Studio.
'****************************************************************
%>
<!--#include file="admin/BBSConfig.asp"-->
<!--#include file="INC/online.asp"-->
<!--#include file="INC/ShowMsg.asp"-->
<!--#include file="INC/header.asp"-->
<!--#include file="INC/style.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="joinboard,forum,bbs,youmeng,友盟论坛">
<title><%=BBS_Config(0)%> - 注册会员</title>
<link href="<%=Css_path%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%
Call onlineuser()
call top()
response.Write "<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""path-table"">"
response.Write "<tr><td>"
response.write "<img src="""& BBS_Skin(3) &"JBB_bullet.gif""> <a href="""& BBSHomeUrl &""">"& BBS_Config(0) &"</a> <img src="""& BBS_Skin(3) &"JBB_bullet.gif""> 会员注册"
response.Write "</td></tr></table>"
if username <> "" then
ShowMsg "我们的记录显示你在本论坛已经注册了 "& username &" 这个用户名. <br>如果你忘记了密码, 请点<a href=""lostpass.asp"">这里</a>. 如果你想要编辑个人资料, 请点 <a href=""usercp.asp?action=editproinfo"">这里</a>."
Call Bottom
response.End
End if
if BBS_Config(7) <> True then
ShowMsg "对不起!~本论坛暂时停止注册,点击 <a href="""&BBSHomeUrl&""">这里</a> 返回首页."
Call Bottom
response.End
End if
url = request.ServerVariables("HTTP_REFERER")
action=trim(request.QueryString("action"))
SELECT Case action
Case "agree"
Call agree()
Case "regform"
Call regform()
Case "reg"
Call reg()
Case else
response.Redirect("?action=agree")
End SELECT
'====================================
Sub reg()
username = Replace(trim(request.Form("username")),"'","")
if Len(username) < CINT(BBS_Config(8)) or Len(username) > CINT(BBS_Config(9)) then
ShowMsg "<b>错误:</b>用户名只可为 "& CINT(BBS_Config(8)) &"-"& CINT(BBS_Config(9)) &" 个字符<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
'----------------------------------------------------------------
usernamestay = BBS_Config(11)
if username <> "" and usernamestay <> "" then
usernamestay=Split(usernamestay,",",-1,1)
For notuser = 0 To UBound(usernamestay,1)
if usernamestay(notuser) = username then
ShowMsg "对不起!~ 您输入的用户名:<font color=""#0000FF""><b> "& username &" </b></font>禁止在本站注册!,请<a href=""javascript:history.back()"">返回</a>重新输入!~"
Call Bottom
response.End
End if
Next
End if
'----------------------------------------------------------------
userpass = Replace(trim(request.Form("userpass")),"'","")
if Len(userpass) < 6 or Len(userpass) > 16 then
ShowMsg "<b>错误:</b>密码只可为 6-16个字符<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
userpass2 = Replace(trim(request.Form("userpass2")),"'","")
if userpass <> userpass2 then
ShowMsg "<b>错误:</b>两次输入的密码不一致<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
email = Replace(trim(request.Form("email")),"'","")
if Instr(4,Email,".") < 1 then Emailtrue = 1
if Instr(2,Email,"@") < 1 then Emailtrue = 1
if Len(Email) < 9 then Emailtrue = 1
if Emailtrue = 1 then
ShowMsg "<b>错误:</b>请输入正确的 Email<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
email2 = Replace(trim(request.Form("email2")),"'","")
if Email <> email2 then
ShowMsg "<b>错误:</b>两次输入的Email不一致<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
'--------------------------------------------------------
if BBS_Config(10)=true then
set rs1 = Conn.ExeCute("select email from JBB_user where email='"& email &"'")
if Not(rs1.Eof and rs1.Bof) then
set rs1 = Nothing
ShowMsg "对不起,本论坛已经限制了一个Email只能注册一个帐号,请重新选择您的Email。<br><br><a href=""javascript:history.back()""><<< 返回上一步</a>~"
Call Bottom
response.End
End if
set rs1 = Nothing
End if
'--------------------------------------------------------
birthday = request.Form("year")&"-"&request.Form("month")&"-"&request.Form("day")
oicq = replace(trim(request.Form("oicq")),"'","")
styleid = trim(request.Form("styleid"))
set rs = server.CreateObject("adodb.recordset")
rs.open "select * from JBB_user where username = '"& username &"'",conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs("username") = username
rs("userpass") = md5(userpass)
rs("usertitle") = replace(trim(request.Form("usertitle")),"'","''")
rs("usergroup") = 5
rs("email") = email
rs("showemail") = request.Form("showemail")
rs("styleid") = styleid
rs("homepage") = replace(trim(request.Form("homepage")),"'","")
if IsNumeric(oicq) then
rs("oicq") = oicq
End if
rs("msn") = replace(trim(request.Form("msn")),"'","")
if IsDate(birthday) then
rs("birthday") = birthday
End if
rs("usersex") = request.Form("usersex")
rs("useradd") = replace(trim(request.Form("useradd")),"'","''")
rs("signature") = replace(rtrim(request.Form("signature")),"'","''")
rs("regtime") = Now()
rs("regip") = userip
rs("lastonline") = Now()
rs("avatars") = request.Form("avatars")
rs.update
else
rs.close
set rs = Nothing
ShowMsg "对不起!~ 您输入的用户名:<font color=""#0000FF""><b> "& username &" </b></font>已经有人注册!,请<a href=""javascript:history.back()"">返回</a>重新输入!~"
Call Bottom
response.End
End if
rs.close
set rs = Nothing
set rs = conn.execute("select userid from JBB_user where username='"& username &"'")
if Not rs.eof then
newuserid = rs(0)
End if
set rs = Nothing
response.Cookies(JBBMasterCookies)("userid") = newuserid
response.Cookies(JBBMasterCookies)("username") = username
response.Cookies(JBBMasterCookies)("userpass") = md5(userpass)
response.Cookies(JBBMasterCookies)("usergroup") = 5
if cstr(styleid) > 1 then
response.Cookies(JBBMasterCookies)("styleid") = styleid
End if
Application.Lock
Application(JBBMasterCookies&"Home_userInfo") = ""
Application.UnLock
ShowMsg "<font color=""#000000"">感谢您在<b> "& board_name &" </b>注册,正在以您的身份登录论坛,如果您不想等待,请点击 <a href="""&BBSHomeUrl&"""><font color=""#0000FF"">这里</font></a> 回到首页</font>"
response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='3; URL="&BBSHomeUrl&"'>")
End Sub
'====================================
Sub regform()
if right(lcase(url),25) <> "register.asp?action=agree" then
response.Redirect("register.asp?action=agree")
End if
%>
<script language="javascript">
<!--
function isok(theform)
{
if (theform.username.value.length < <%=CINT(BBS_Config(8))%>)
{
alert("用户名不能为空且至少<%=CINT(BBS_Config(8))%>个字符!");
theform.username.focus();
return (false);
}
if (theform.username.value.length > <%=CINT(BBS_Config(9))%>)
{
alert("用户名不能超过<%=CINT(BBS_Config(9))%>个字符!");
theform.username.focus();
return (false);
}
if (theform.userpass.value.length<6)
{
alert("用户密码不能为空且至少6个字符!");
theform.userpass.focus();
return (false);
}
if (theform.userpass.value!=theform.userpass2.value)
{
alert("您的密码确认与上面密码不符!");
theform.userpass2.focus();
return (false);
}
if (theform.email.value.length<5|theform.email.value.indexOf("@")==-1|theform.email.value.indexOf(".")==-1)
{alert("请输入正确的Eail地址!");
theform.email.focus( );
return(false);}
if (theform.email.value!=theform.email2.value)
{
alert("您两次输入的Email不相符!");
theform.email2.focus();
return (false);
}
return (true);
}
-->
</script>
<form name="theForm" method="post" action="?action=reg" onsubmit="return isok(this)">
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr class="table-title">
<td colspan="2">带 <font color="#FF0000">*</font> 的项目都要求填写.请注意密码区分大小写.</td>
</tr>
<tr class="table-light">
<td width="35%"><font color="#FF0000">*</font>用户名:(<%=CINT(BBS_Config(8))&"-"&CINT(BBS_Config(9))%>个字符)</td>
<td width="65%" class="table-light">
<input name="username" type="text" id="username"></td>
</tr>
<tr>
<td class="table-dark"><font color="#FF0000">*</font>密码:(6-16个字符)</td>
<td class="table-dark"><input name="userpass" type="password" id="userpass" maxlength="16"></td>
</tr>
<tr>
<td class="table-light"><font color="#FF0000">*</font>确认密码:</td>
<td class="table-light"><input name="userpass2" type="password" id="userpass2" maxlength="16"></td>
</tr>
<tr>
<td class="table-dark"><font color="#FF0000">*</font>Email:<br>
请输入一个有效的Email地址,你可以设置隐藏.</td>
<td class="table-dark"><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td class="table-light"><font color="#FF0000">*</font>确认
Email</td>
<td class="table-light"><input name="email2" type="text" id="email2"></td>
</tr>
</table>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table"id=jb style="DISPLAY: none">
<tr class="table-title">
<td colspan="2">个人喜好</td>
</tr>
<tr>
<td width="35%" class="table-light">在个人资料中显示Email?</td>
<td class="table-light">是
<input name="showemail" type="radio" value="1" checked>
否
<input type="radio" name="showemail" value="0"></td>
</tr>
<tr>
<td class="table-dark">用户头衔</td>
<td class="table-dark"><input name="usertitle" type="text" id="usertitle"></td>
</tr>
<tr class="table-light">
<td valign="top" class="table-light">个性头像</td>
<td>
<table width="400" border="0" cellpadding="4" cellspacing="1">
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -