📄 reg.asp
字号:
<!--#include file="inc/conndb.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="zhuru.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员注册-<%=bbsname%></title>
<link href="images/hotlt.css" rel="stylesheet" type="text/css">
</head>
<%
if request("submit")="提 交" then
name=request("name")
pwd=request("pwd")
pwd1=request("pwd1")
Code=trim(request.form("verify_code"))
if InStr(name,"or")<>0 or InStr(name,"'")<>0 or InStr(name,"`")<>0 or InStr(name,"=")<>0 or InStr(name,"-")<>0 or InStr(name,",")<>0 or InStr(name,"and")<>0 then
Response.Write "<script language=JavaScript>{alert('用户名含有非法字符!');history.back();}</script>"
Response.End
end if
if cstr(session("GetCodedl"))<>cstr(Code) then
Response.Write("<script language=javascript>alert('认证码错误!');history.back()</script>")
response.end
else
end if
if pwd<>pwd1 then
response.write"<script>alert('两次密码不同!');history.back();</script>"
else
sql="select * from user where name='"&name&"'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if not rs.eof then
response.write"<script>alert('该用户名已经存在!');history.back();</script>"
else
rs.close
rs.open"select * from user",conn,1,3
rs.addnew
rs("name")=name
rs("pwd")=md5(pwd)
rs.update
Response.Cookies("mctb_name")=name
Response.Cookies("mctb_name").Expires=Now() + 30
response.write"<script>alert('用户注册成功!');window.navigate('index.asp');</script>"
end if
rs.close
end if
end if
%>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="250" valign="top"><img src="images/bbslogo.jpg" ></td>
<td width="538"><form name="form1" method="get" action="index.asp" style="margin:5px;">
<input name="q" type="text" id="q" value="<%=keys%>" size="30">
<input type="submit" value=" 搜 索 ">
<input name="so" type="radio" value="title" checked>
搜索标题
<input type="radio" name="so" value="name">
搜索作者
</form></td>
<td width="160" align="center"><%
if name= "" then
response.write"<A href='login.asp'>登录</A> | <A href='reg.asp'>注册</A>"
elseif name<> "" then
response.write name&" | <A href='exit.asp'>退出</A>"
end if
%></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="tit">
<tr bgcolor="#E8F3FF">
<td height="25" bgcolor="#FFF5F0"> <a href="index.asp"><%=bbsname%></a> >> 会员注册</td>
<td width="20%" bgcolor="#FFF5F0"> </td>
</tr>
</table>
<form name="save" method="post" action="" onSubmit="return regcheck(this);">
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="30%" height="30" align="right"><strong>帐 号:</strong></td>
<td>
<input name="name" type="text" id="name" size="20" maxlength="20">
</td>
</tr>
<tr>
<td height="30" align="right"><strong>密 码:</strong></td>
<td><input name="pwd" type="password" id="pwd" size="20" maxlength="20"></td>
</tr>
<tr>
<tr>
<td height="30" align="right"><strong>确认密码:</strong></td>
<td><input name="pwd1" type="password" id="pwd1" size="20" maxlength="20"></td>
</tr>
<tr>
<td height="30" align="right"><strong>验证码:</strong></td>
<td><input name="verify_code" type="text" id="verify_code" size="4" maxlength="4">
<img src="inc/dlzcyz.asp"></td>
</tr>
<tr>
<td height="30" align="right"> </td>
<td><input name="submit" type="submit" id="submit" value="提 交" class="bnsrh">
<input name="reset" type="reset" id="reset" value="重新填写" class="bnsrh"></td>
</tr>
</table>
</form>
<script language="JavaScript1.2">
function regcheck(formct){
if (formct.name.value=='' ){
alert('帐号不能为空,请填写');
return false;
}
if (formct.pwd.value=='' ){
alert('密码不能为空,请填写');
return false;
}
if (formct.pwd1.value=='' ){
alert('验证密码不能为空,请填写');
return false;
}
if (formct.verify_code.value=='' ){
alert('验证码不能为空,请填写');
return false;
}
formct.Submit.disabled=true;
}
</script>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#FFF5F0">图书馆系统 </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -