📄 user_reg.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/bloginfo.asp"-->
<!--#include file="inc/syscode.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim show
call sysshow()
call sub_showreg()
show=replace(show,"$show_list$",show_reg)
response.Write show
call bottom()
sub sub_showreg()
dim rs
dim regtext,str_usertype
show_reg="当前位置:<a href='index.asp'>首页</a>→注册新博客<hr noshade>"
if EnableUserReg<>"true" then
show_reg=show_reg&"当前系统已关闭注册。"
else
set rs=conn.execute("select regtext from bloginfo")
regtext=rs(0)
str_usertype="<select name=usertype id=usertype>"
str_usertype=str_usertype&"<option value=0 selected>请选择类别</option>"
set rs=conn.execute("select id,typename from usertype")
do while not rs.eof
str_usertype=str_usertype&"<option value="&rs(0)&">"&rs(1)&"</option>"
rs.movenext
loop
str_usertype=str_usertype&"</select><font color=#ff0000> *</font>"
show_reg=show_reg&"<form name=reg method=post action=user_chkreg.asp onSubmit='return VerifySubmit()'>"& vbcrlf
show_reg=show_reg&"<table width=80% border=0 cellspacing=0 cellpadding=0>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td colspan=2>"®text&"</td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td height=40 valign=bottom>"& vbcrlf
show_reg=show_reg&"<input name=passregtext id=passregtext type=radio value='1' checked>"& vbcrlf
show_reg=show_reg&"同意 <input type=radio name=passregtext id=passregtext value='0'>"& vbcrlf
show_reg=show_reg&"不同意 </td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td colspan=2><hr noshade></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>用户名:</div></td>"& vbcrlf
show_reg=show_reg&"<td width=53% > <input name=username type=text id=username size=20 maxlength=30><font color=#ff0000> *</font>(不能使用中文)"& vbcrlf
show_reg=show_reg&"</td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>昵称:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=nickname type=text size=20 maxlength=30>(可以使用中文)</td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr>"& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>密码:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=password type=password id=password size=20 maxlength=30><font color=#ff0000> *</font></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>验证密码:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=repassword type=password id=repassword size=20 maxlength=30><font color=#ff0000> *</font></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>找回密码提示问题:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=question type=text id=question size=30 maxlength=30><font color=#ff0000> *</font></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>提示问题答案:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=an type=text id=an size=30 maxlength=30><font color=#ff0000> *</font></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>性别:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=sex type=radio value=1 checked>"& vbcrlf
show_reg=show_reg&"男 <input type=radio name=sex value=2>"& vbcrlf
show_reg=show_reg&"女 </td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>Email:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=email type=text size=20 maxlength=30><font color=#ff0000> *</font></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>blog名:</div></td>"& vbcrlf
show_reg=show_reg&"<td><input name=blogname type=text size=20 maxlength=30><font color=#ff0000> *</font></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr> "& vbcrlf
show_reg=show_reg&"<td width=30% height=25><div align=right>blog类别:</div></td>"& vbcrlf
show_reg=show_reg&"<td>"&str_usertype&"</td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"<tr>"& vbcrlf
show_reg=show_reg&"<td height=25 colspan=2> <div align=center>"& vbcrlf
show_reg=show_reg&"<input type=submit name=Submit value=提交> "& vbcrlf
show_reg=show_reg&"<input type=reset name=Submit2 value=重置>"& vbcrlf
show_reg=show_reg&"</div></td>"& vbcrlf
show_reg=show_reg&"</tr>"& vbcrlf
show_reg=show_reg&"</table>"& vbcrlf
show_reg=show_reg&"</form>"& vbcrlf
end if
set rs=nothing
end sub
%>
<SCRIPT language="javascript">
<!--
function checkerr(string)
{
var i=0;
for (i=0; i<string.length; i++)
{
if((string.charAt(i) < '0' || string.charAt(i) > '9') && (string.charAt(i) < 'a' || string.charAt(i) > 'z')&& (string.charAt(i)!='-'))
{
return 1;
}
}
return 0;//pass
}
function del_space(s)
{
for(i=0;i<s.length;++i)
{
if(s.charAt(i)!=" ")
break;
}
for(j=s.length-1;j>=0;--j)
{
if(s.charAt(j)!=" ")
break;
}
return s.substring(i,++j);
}
function VerifySubmit()
{
if (document.reg.passregtext[1].checked )
{
alert("您不同意注册条款,不能注册!");
return false;
}
uid = del_space(document.reg.username.value);
if (uid.length == 0)
{
alert("请输入用户名!");
return false;
}
blogname = del_space(document.reg.blogname.value);
if (blogname.length == 0)
{
alert("请输入您的blog名!");
return false;
}
if(checkerr(uid) == "1"){
alert("请用0-9的数字和a-z的字母及'-'号,不允许下划线和怪字符(如!@#$%^等);")
return false
}
uid = del_space(document.reg.username.value);
if (uid.length < 3)
{
alert("用户名要大于3个字符!");
return false;
}
pwd = del_space(document.reg.password.value);
if (pwd.length == 0)
{
alert("请输入密码!");
return false;
}
pwd = del_space(document.reg.password.value);
if (pwd.length < 6)
{
alert("密码要大于6个字符!");
return false;
}
pwd2 = del_space(document.reg.repassword.value);
if (pwd2!=pwd)
{
alert("两次输入的密码不一致!");
return false;
}
tishi = del_space(document.reg.question.value);
if (tishi.length == 0)
{
alert("请输入密码提示问题");
return false;
}
tsda = del_space(document.reg.an.value);
if (tsda.length == 0)
{
alert("请输入密码提示问题答案!");
return false;
}
email = del_space(document.all("email").value);
if (email.length == 0)
{
alert("请输入Email!");
return false;
}
email = del_space(document.all("email").value);
if (email.indexOf("@")==-1)
{
alert("Email地址无效!");
return false;
}
email = del_space(document.all("email").value);
if (email.indexOf(".")==-1)
{
alert("Email地址无效!");
return false;
}
if (document.reg.usertype.value == 0)
{
alert("请选择您的类别!");
return false;
}
return true;
}
//-->
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -