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

2023-12-05 0 155

第一个办法:用两个文件来解决这个问题: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]

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 编程10000问 怎样避免直接在地址栏敲入URL即可绕过登录页的错误? https://www.u-9.cn/biancheng/bc10000/96034.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务