欢迎来到代码驿站!

当前位置:首页 >

怎样避免直接在地址栏敲入URL即可绕过登录页的错误?

时间:2021-02-05 09:35:40|栏目:|点击:

第一个办法:用两个文件来解决这个问题:userandpwd.aspsecretarticle.asp。前者只负责提供输入用户名和密码,由后者来完成验证工作。这样即使知道了asppwdrst.asp 所在的 URL,也决不会看到什么内容的。

userandpwd.asp

< html >

< body >

< form name="form1"action=

"secretarticle.asp" method_

="POST" >

< input type="hidden" name="VTI-GROUP" value=_"0" >

< div align="center" >< center >< p >

账号< input type="text"

name="T1" size="20" >

密码< input type ="password" name="T2" size=_"20" >

< input type="submit" value="确认" name=_"B1" >

< /p >< /center >< /div >

< /form >

< /body >

< /html >

 

secretarticle.asp

' 秘密资料所在页,并负责验证账号和密码(账号:liyanbing,密码:13066093625,通过之后,才可浏览.

< html >

< % if rtrim(request.form("t1"))=

 "liyanbing” and_ rtrim(request.form("t2"))=

 "13066093625" then % >

< body >

< p align=“center” >< font face="宋体" size="7"_ color="#0000ff" >

恭喜,登录成功!

< /font >< /p >

< /body >

< % else % >

< body >

< p align="center" >< font face="宋体" size="7"_ color="#0000ff" >

请输入用户名和密码!

< /font >< /p >

< /body >

< % end if % >

< /html >

 

第二个办法:更简单一些,但实现同样的功能:

login.asp

' 登录页面

< %@ Language=VBScipt % >

< @Response.Buffer=true% >

< html >

< head >< title >撼雪喷云之欢迎登录< /title >< /head >

< body >

< %

if request("username")="liyanbing" and request("password")="13066093625" then

response.redirect "chunfeng.asp"

' 预设账号:liyanbing;密码:13066093625;资料页面:chunfeng.asp.

end if

% >

< font style="font-size:12pt" >请输入您的账号和密码"< /font >< br >

< form action="login.asp" method="post" >

< br >账号:< input type=text name="username" >

< br >密码:< input type=password name="password" >

< br >< input type=submit value="登录" >

< /form >

< /body >

< /html >

 

[1]

上一篇:电影系统调用“宝丽通”加速播放器,任意拖动不会卡

栏    目:

下一篇:Powershell小技巧之通过EventLog查看近期电脑开机和关机时间

本文标题:怎样避免直接在地址栏敲入URL即可绕过登录页的错误?

本文地址:http://www.codeinn.net/misctech/57482.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有