登录注册模块代码

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
rs("we nti")=trim(request.form("we nti"))
rs("daa n")=trim(request.form("daa n"))
rs.update
rs.close
set rs=nothing
respon se.write "<script Ian guage=javascript> alert('注册成功,点击确定立即登录!
%>
</td>
</tr>
</table>
</body>
</html>
login ok.asp
<!--#i nelude file="conn.asp"-->
<%
sessi on .timeout=30
if request("act ion ")="logi n" the n
n ame=trim(request.form(" name"))
for each query_ name in request.querystri ng
for i=0 to ubo un d(chk)
if in str(lcase(request.querystri ng(query_ name)),chk(i))<>0 the n
respon se.write "<script Ian guage=javascript>alert('传参错误! 参
end if
sql="select * from user"
set rs=server.createobject("adodb.recordset")
rs.ope n sql,c onn ,1,3
rs.add new
rs(" name")=trim(request.form(" name"))
rs("pwd")=trim(request.form("pwd"))
加密页</a></td>
<html>
<head>
<meta http-equiv="c onten t-type" conten t="text/html; charset=gb2312">
登陆</a>
注销登陆</a>
<title>无标题文档</title>
</head>
<body><!--#i nelude file="top.asp"-->
<form name="form1" method="post" action=”?action=reg" onsubmit="return ch kform(this)">
<table width="347" border="1" cellpadding="5" cellspacing="0">
<tr>
<%
if request("act ion ")="reg" the n
set rs=server.createobject("adodb.recordset")
rs.ope n "select * from user where name='"&trim(request(”name"))&""',conn ,1,1
</tr>
<tr>
<td colspa n="2"> <in put type="submit" n ame="submit" value="
<input type="reset" name="submit" value="重置"> </td>
</tr>
</table>
</form>
</td>
</tr>
<table border="1" cellspacin g="0" cellpaddi ng="5">
<tr>
<td width="116">用户名</td>
<td width="116"><input name="name" type="text" id="name"></td>
</tr>
<tr>
if err the n
err.clear
set conn = nothing
respo nse.write "数据库连接出错,请检查conn .asp中的连接字符串。”
resp on se.e nd
end if
function closedb
conn .close
set conn=nothing
end fun cti on
</tr>
</table>
</form>
<%
else
%>
<table border="1" cellspacin g="0" cellpaddi ng="5">
<tr>
<td width="303"><%=sessio n(”name")%〉,您已经成功登陆</td>
</tr>
</table>
<%
end if
<table width="398" border="1" cellpadding="5" cellspacing="0">
<tr>
<td width="130">请输入用户名</td>
pwd=trim(request.form("pwd"))
if n ame="" or pwd="" the n
resp on se.redirect ("logi n. asp")
end if
set rs=server.createobject("adodb.recordset")
sql="select * from user where n ame='"&n ame&"'a nd pwd='"&pwd&""'
conn .asp
<%
db="data/data.mdb"'数据库存放目录
on error resume n ext
set conn=server.createobject("adodb.c onnection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath(db)
</tr>
<tr>
<td>密码提示问题</td>
<td> <in put n ame="we nti" type="text" id="we nti"></td> </tr>
<tr>
<td>密码提示答案</td>
<td> <in put n ame="daa n" type="text" id="daa n"> </td>
>
<tr>
<td><a href="/webjx/"";index.asp">首页</a>
<%
if sessi on(”name")="" the n
%>
<a href="/webjx/"";reg.asp">
<a href="/webjx/"";pwd.asp">
else
%>
欢迎您<%=session(”name")%〉
%>
logino ut.asp
<%
sessi on(”name")=""
respon se.write "<script Ian guage=javascript> alert('退出登陆成
功!');locati on. href(' in dex.asp');</script>"
resp on se.e nd
%>
pwd.asp
<!--#i nclude file="conn.asp"-->
<html>
<head>
<meta http-equiv="c onten t-type" conten t="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body><!--#i nclude file="top.asp"-->
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0"
>
<tr>
<td><p>找回密码</p>
<form n ame="form1" method="post" action="pwd2.asp?acti on=pwd">
数"&query_ name&"的值中包含非法字符串!
\n\n ');locati on='"&request.servervariables("http_referer") &"'</script>"
resp on se.e nd
end if
n ext
n ext
end if
%>
reg.asp
<!--#i nclude file="conn.asp"-->
if rs.recordco un t>0 the n
respon se.write "<script Ian guage='javascript'>w in dow.alert('您输入的用户名已存在,
请返回重新输入!');history.back(-1);</script>"
resp on se.e nd()
%>
<%
dim badword
badword="'|a nd|select|update|chr|delete|%20from|;|i nsert|mid|master.|set|chr(37)|
_n
if request.querystri ng<>"" the n
chk=split(badword,T)
<td>密码</td>
<td> <in put n ame="pwd" type="password" id="pwd"></td> </tr>
<tr>
<td colspa n="2"> <in put type="submit" n ame="submit" value="
<input type="reset" name="submit" value="重置"></td>
<%
end if
%>
<a href="/webjx/"";jiami.asp">
</tr>
</table>
<br>
logi n.asp
<!--#i nelude file="conn.asp"-->
注册</a> <a href="/webjx/"";login.asp">
忘记密码?</a><%
,<a href="/webjx/"";logi nout.asp">
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0"
>
<tr>
<td>
用户登陆
<%
if sessi on(”name")="" the n
%>
<form name="form1" method="post" action="loginok.asp?action=login" onsubm it="return chkform(this)">
');locati on. replace('logi n. asp');</script>"
resp on se.e nd
end if
%>
<html>
<head>
<meta http-equiv="c onten t-type" conten t="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body><!--#i nelude file="top.asp"-->
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0"
>
<tr>
<td>用户注册
</table>
</body>
</html>
top.asp
<meta http-equiv="c onten t-type" conten t="text/html; charset=gb2312">
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0
<td width="142">用户名</td>
<td width="179"><i nput name=" name" type="text" id=" name"x/td>
</tr>
<tr>
<td>密码</td>
<td> <in put n ame="pwd" type="password" id="pwd"></td>
rs.ope n sql,c onn ,1,1
if not rs.eof the n
sessi on(”name")=n ame
resp on se.redirect"edit.asp"
else
resp on se.redirect"error.asp"
resp on se.e nd
end if
endBaidu Nhomakorabeaif
相关文档
最新文档