需要帮忙~~!!!!

kingice1010 2002-12-31 05:28:09
我需要做一个象QQ一样的密码保护系统,请问用ASP怎么实现呀?
...全文
28 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
caoshangfei 2003-01-02
  • 打赏
  • 举报
回复
adoaccess是他的数据库连接文件哦。你要干麻。自己写啊。他的数据库跟你的数据库又不一样。。
kingice1010 2003-01-02
  • 打赏
  • 举报
回复
说呀!!!
kingice1010 2002-12-31
  • 打赏
  • 举报
回复
还有几个文件呢???帮帮我呀!!!!
蘑菇 2002-12-31
  • 打赏
  • 举报
回复
up
kingice1010 2002-12-31
  • 打赏
  • 举报
回复
兄弟,Adoaccess.asp这个文件呢?
kingice1010 2002-12-31
  • 打赏
  • 举报
回复
好,谢谢大家了!我来看看!!
liuqinyi 2002-12-31
  • 打赏
  • 举报
回复
if action="question" then
'显示密码提示问题的页面。保存bbs_login_name变量
bbs_login_name=request("name")
bbs_login_question=request("question")
bbs_login_answer=Request("bbs_login_answer")
sql="select * from bbs_login where bbs_login_name='"&bbs_login_name&"' and bbs_login_question='"&bbs_login_question&"' and bbs_login_answer='"&bbs_login_answer&"'"

set rs=cnn.execute(sql)
if rs.eof then
'如果没有该记录,则问题答案不正确,需要从新输入,返回前一个页面

data="对不起,你输入的答案不正确!"
%>
<script language="javascript">
alert("<%=data%>")
window.history.back()
</script>
<%
Response.End
else

end if

%>
<br>
<br>
<br>
<table cellspacing="0" cellpadding="0" width="760" align="center" border="0">
<tbody>
<tr align="middle">
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td bgcolor="#007bf7" height="5"></td>
</tr>
</tbody>
</table>

</td>
</tr>
<tr align="middle">
<td bgcolor="#007bf7" height="5"></td>
</tr>
</tbody>
</table>

<table cellspacing="0" cellpadding="0" width="760" align="center" border="0">
<tbody>
<tr>
<td bgcolor="#3399ff" colspan="4" height="20"></td>
</tr>
<tr>
<td valign="top" width="160" bgcolor="#3399ff">
<table cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
<tbody>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<!--
<tr>
<td height="25">
<li><b><A href="register1.asp"><font color="#ffffff">会员注册</font></A></b></li>
</td>
</tr>-->
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="edit_profile.asp"><font color="#ffffff">个性签名</font></A></b> </li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="password.asp"><font color="#ffffff">密码修改</font></A></b> </li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="forget_pwd.asp"><font color="#ffffff">忘记密码</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="signon.asp"><font color="#ffffff">用户登录</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="signoff.asp"><font color="#ffffff">退出登录</font></A></b></li>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="1"></td>
</tr>
</tbody>
</table>
</td>
<td valign="top" align="middle" width="5" bgcolor="#44b5ff"> </td>
<td valign="top" align="right" colspan="2">
<table height="20" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr bgcolor="#00ccff" valign="center">
<td class="p1"></td>
</tr>
<tr bgcolor="#3399ff">
<td height="1"></td>
</tr>
</tbody>
</table>
<br>
<table cellspacing="0" cellpadding="0" width="218" border="0">
<tbody>
<tr>
<td><IMG height=19 src="images/forget_pwd.gif" width=218></td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="2" width="96%" bgcolor="#0167cc" border="0">
<tbody>
<tr>
<td>

<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR align=middle bgColor=#ffffff>
<TD>
<!--显示给用户密码,如果用户点击确定的话,那么进入登录成功的页面即传递给登录页面bbs_login_name和bbs_login_password两个变量-->
<FORM action="signon.asp?action=submit" method="post" name=form1>
<P> </P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="80%">
<TBODY>

<TR>
<br>
<br>
<br>
<input type=hidden name=bbs_login_name value=<%=rs("bbs_login_name")%>></input>
<input type=hidden name=bbs_login_password value=<%=rs("bbs_login_password")%>></input>
<TD width="40%" align=center>您的密码是</TD>
<td width="40%" align=center><label><%=rs("bbs_login_password")%></label></td>
</td>
<TD align=middle colSpan=2> </TD></TR>
</TBODY>
</TABLE>
<INPUT type=submit value="确 认" id=submit1 name=submit1>
</FORM>
</TD></TR>
<TR align=middle bgColor=#ffffff><TD>

<P><BR> </P>
</TD></TR>
</TBODY>
</TABLE>
</td>
</tr></tbody>
</table></tr></tbody></table>

<%
rs.close
Response.End
else
%>

<%end if%>


</BODY>
</HTML>

当然了,其实是很简单的,应该能够明白的。
liuqinyi 2002-12-31
  • 打赏
  • 举报
回复

if action="pwd" then
'显示密码提示问题的页面。保存bbs_login_name变量
bbs_login_name=request("name")
sql="select * from bbs_login where bbs_login_name='"&bbs_login_name&"'"
set rs=cnn.execute(sql)
%>
<br>
<br>
<br>
<table cellspacing="0" cellpadding="0" width="760" align="center" border="0">
<tbody>
<tr align="middle">
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td bgcolor="#007bf7" height="5"></td>
</tr>
</tbody>
</table>

</td>
</tr>
<tr align="middle">
<td bgcolor="#007bf7" height="5"></td>
</tr>
</tbody>
</table>

<table cellspacing="0" cellpadding="0" width="760" align="center" border="0">
<tbody>
<tr>
<td bgcolor="#3399ff" colspan="4" height="20"></td>
</tr>
<tr>
<td valign="top" width="160" bgcolor="#3399ff">
<table cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
<tbody>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="register.asp"><font color="#ffffff">会员注册</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<!--
<tr>
<td height="25">
<li><b><A href="register1.asp"><font color="#ffffff">会员注册</font></A></b></li>
</td>
</tr>-->
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="password.asp"><font color="#ffffff">密码修改</font></A></b> </li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="forget_pwd.asp"><font color="#ffffff">忘记密码</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="signon.asp"><font color="#ffffff">用户登录</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="signoff.asp"><font color="#ffffff">退出登录</font></A></b></li>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="1"></td>
</tr>
</tbody>
</table>
</td>
<td valign="top" align="middle" width="5" bgcolor="#44b5ff"> </td>
<td valign="top" align="right" colspan="2">
<table height="20" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr bgcolor="#00ccff" valign="center">
<td class="p1"></td>
</tr>
<tr bgcolor="#3399ff">
<td height="1"></td>
</tr>
</tbody>
</table>
<br>
<table cellspacing="0" cellpadding="0" width="218" border="0">
<tbody>
<tr>
<td><IMG height=19 src="images/forget_pwd.gif" width=218></td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="2" width="96%" bgcolor="#0167cc" border="0">
<tbody>
<tr>
<td>

<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR align=middle bgColor=#ffffff>
<TD>
<FORM action="forget_pwd.asp?action=question" method="post" name=form1>
<P> </P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="80%">
<TBODY>

<TR>
<br>
<TD width="40%">密码提示问题</TD>
<TD><%=rs("bbs_login_question")%>
<!--使用隐藏变量提交表单-->
<input type=hidden name="name" value=<%=bbs_login_name%>></input>
<input type=hidden name="question" value=<%=rs("bbs_login_question")%>></input>
</TD></TR>
<TR>
<tr>
<td width="40%">密码提示答案</td>
<td><input name=bbs_login_answer></td></tr>
</tr>
<TD align=middle colSpan=2> </TD></TR>
</TBODY>
</TABLE>
<INPUT type=submit value="确 认" id=submit1 name=submit1>
</FORM>
</TD></TR>
<TR align=middle bgColor=#ffffff><TD>

<P><BR> </P>
</TD></TR>
</TBODY>
</TABLE>
</td>
</tr></tbody>
</table></tr></tbody></table>

<%
Response.End
else
%>

<%end if

liuqinyi 2002-12-31
  • 打赏
  • 举报
回复
算了,最后一天,干脆给你我的源码。哈哈;)
<%@ Language=VBScript %>

<%Response.Buffer=true%>
<!--#include file="Adoaccess.asp" -->
<HTML>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/default.css">

</head>
<BODY>
<%
action=request("action")
'接受了动作值,如果为提交的话,那么执行相应的操作

'判断内容是否为空,即""或者null,或者empty.
Function CheckNull(data)
if isempty(data) or data="" or isnull(data) then
checknull=true
else
checknull=false
end if
End Function

'长度的检验
Function CheckLen(data,len1,len2)
if len(data)<len1 or len(data)>len2 then
CheckLen=false
else
CheckLen=true
end if

End Function

'有效性检验,针对的是用户名的有效性检验。
Function Checkvalue(data)
for i=1 to len(data)
if (asc(mid(data,i,1))>47 and asc(mid(data,i,1))<58) or (asc(mid(data,i,1))>96 and asc(mid(data,i,1))<123) or asc(mid(data,i,1))=95 or asc(mid(data,i,1))<0 then
checkvalue=true
else
checkvalue=false

exit for
end if

next
End Function

if action="" then
%>

<br>
<br>
<br>
<table cellspacing="0" cellpadding="0" width="760" align="center" border="0">
<tbody>
<tr align="middle">
<td>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td bgcolor="#007bf7" height="5"></td>
</tr>
</tbody>
</table>

</td>
</tr>
<tr align="middle">
<td bgcolor="#007bf7" height="5"></td>
</tr>
</tbody>
</table>

<table cellspacing="0" cellpadding="0" width="760" align="center" border="0">
<tbody>
<tr>
<td bgcolor="#3399ff" colspan="4" height="20"></td>
</tr>
<tr>
<td valign="top" width="160" bgcolor="#3399ff">
<table cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
<tbody>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="register.asp"><font color="#ffffff">会员注册</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<!--
<tr>
<td height="25">
<li><b><A href="register1.asp"><font color="#ffffff">会员注册</font></A></b></li>
</td>
</tr>-->
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="password.asp"><font color="#ffffff">密码修改</font></A></b> </li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="forget_pwd.asp"><font color="#ffffff">忘记密码</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="signon.asp"><font color="#ffffff">用户登录</font></A></b></li>
</td>
</tr>
<tr>
<td height="1" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="25">
<li><b><A href="signoff.asp"><font color="#ffffff">退出登录</font></A></b></li>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="1"></td>
</tr>
</tbody>
</table>
</td>
<td valign="top" align="middle" width="5" bgcolor="#44b5ff"> </td>
<td valign="top" align="right" colspan="2">
<table height="20" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr bgcolor="#00ccff" valign="center">
<td class="p1"></td>
</tr>
<tr bgcolor="#3399ff">
<td height="1"></td>
</tr>
</tbody>
</table>
<br>
<table cellspacing="0" cellpadding="0" width="218" border="0">
<tbody>
<tr>
<td><IMG height=19 src="images/forget_pwd.gif" width=218></td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="2" width="96%" bgcolor="#0167cc" border="0">
<tbody>
<tr>
<td>

<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR align=middle bgColor=#ffffff>
<TD>
<FORM action="forget_pwd.asp?action=submit" method="post" name=form1>
<P> </P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="80%">
<TBODY>

<TR>
<br>
<TD width="40%">注 册 名</TD>
<TD><INPUT name=bbs_login_name> </TD></TR>
<TR>
<TD align=middle colSpan=2> </TD></TR>
</TBODY>
</TABLE>
<INPUT type=submit value="确 认" id=submit1 name=submit1>
</FORM>
</TD></TR>
<TR align=middle bgColor=#ffffff><TD>

<P><BR> </P>
</TD></TR>
</TBODY>
</TABLE>
</td>
</tr></tbody>
</table></tr></tbody></table>


<%
Response.End
else%>

<%end if



if action="submit" then

'取得变量的值,如果是空的话,那么指向action="",否则继续判断是否存在该用户名!
bbs_login_name=Request("bbs_login_name")

if bbs_login_name="" then
Response.Redirect "forget_pwd.asp"
else

end if

errorcode=array("对不起,你的用户名不可以为空!","对不起,你的密码不可以为空!","对不起,你没有填写密码提示问题!","对不起,你没有填写密码提示答案!","对不起,你的E-Mail不可以为空!","对不起,你输入的用户名格式不对!","对不起,你输入的密码格式不对!","对不起,您输入的密码长度不对!","对不起,你输入的密码不一致!","对不起,你输入的E-Mail可能是错误的!","对不起,您输入的注册名是错误的。请重新输入!","对不起,您输入的用户名长度不对!","对不起,您输入的邮箱是错误的!")

if checknull(bbs_login_name) then
data=errorcode(0)
%>
<script language="javascript">
alert("<%=data%>")
window.history.back()
</script>
<%
Response.End
else

end if

if checklen(bbs_login_name,4,16) then

else
data=errorcode(11)
%>
<script language="javascript">
alert("<%=data%>")
window.history.back()
</script>
<%
Response.End
end if

if checkvalue(bbs_login_name) then

else
data=errorcode(10)
%>
<script language="javascript">
alert("<%=data%>")
window.history.back()
</script>
<%
Response.End
end if
'输入用户名的验证通过,开始验证数据库中是否有该记录!
sql="select * from bbs_login where bbs_login_name='"&bbs_login_name&"'"
set rs=cnn.execute(sql)
if rs.eof then

data="对不起,你输入的用户名不存在!"
%>
<script language="javascript">
alert("<%=data%>")
window.history.back()
</script>
<%
Response.End
else
rs.close
set rs=nothing
Response.Redirect "forget_pwd.asp?action=pwd&name="&bbs_login_name
end if

%>


<%
Response.End
else
%>

<%end if

梦归零 2002-12-31
  • 打赏
  • 举报
回复
哈,哈,不用俺说了。
宝贝都答了。
这回懂了吧。
兄弟。
新年快乐。
liuqinyi 2002-12-31
  • 打赏
  • 举报
回复
在用户注册的时候需要输入密码的回答问题,和密码的答案,然后你存入数据库表中。
在用户丢失密码的时候,用户登录找回密码界面,然后输入号码,这也就是你的用户ID,然后是根据这个找到密码的问题,用户继续填写答案,如果正确继续处理,错误返回。
处理过程是这样的分为两种,如果是立即显示在页面就直接从数据库表中读取出密码来就可以了,如果是邮件的话,就利用邮件系统发送给用户一个超级连接,后面跟url+参数,参数的内容就是用户ID,然后就是调用密码修改功能了!
kingice1010 2002-12-31
  • 打赏
  • 举报
回复
还是不懂,能具体点吗?
梦归零 2002-12-31
  • 打赏
  • 举报
回复
说具体点吗?
不就是个数据更新的过程吗?
kingice1010 2002-12-31
  • 打赏
  • 举报
回复
帮帮我呀~!!
caoshangfei 2002-12-31
  • 打赏
  • 举报
回复
很简单的。慢慢想吧。。
kingice1010 2002-12-31
  • 打赏
  • 举报
回复
新年快乐!
kingice1010 2002-12-31
  • 打赏
  • 举报
回复
有知道的吗???

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧