用密码验证来保护动感首页
下面的程序是阿喔动感管理通用程序,十分简单不消解释了吧!
if username="admin" and password="admin" then
请记得修改两个admin辨别用户名和密码!
login.asp
<html>
<head>
<title>管理者登陆</title>
<link rel="stylesheet" href=../../"download.css">
</head>
<body>
<div align="center"><center>
<table border="0" cellspacing="1" width="90%">
<tr>
<td> <form method="post"
action="chklogin.asp">
<table width="45%" border="1"
cellspacing="0" cellpadding="1" align="center"
bordercolordark="#ecf5ff"
bordercolorlight="#6699cc">
<tr>
<td><table
width="100%" border="0" cellspacing="1"
cellpadding="1">
<tr>
<td width="33%"
align="right" height="30">用户名:</td>
<td
width="67%"><input name="username" maxlength="20"
class="smallinput" size="20"> </td>
</tr>
<tr>
<td width="33%"
align="right" height="30">密 码:</td>
<td
width="67%"><input type="password" name="password"
maxlength="16" class="smallinput"
size=&
quot;20"> </td>
</tr>
<tr>
<td
colspan="2" height="15"></td>
</tr>
</table>
</td>
</tr>
<tr align="center">
<td
height="40">
<input type="submit" name="submit" value="确
定" class="buttonface">
&nbsp;
<input type="reset" name="submit2" value="重
写" class="buttonface">
</td>
</tr>
</table>
</form>
<p align="center"> </td>
</tr>
</table>
</center></div>
</body>
</html>
__________________________________________________________________
chklogin.asp
<%
dim sql
dim rs
dim seekerrs
dim founduser
dim username
dim companyid
dim password
dim errmsg
dim founderr
founderr=false
founduser=false
username=request.form("username")
password=request.form("password")
if username="" then
response.redirect "index.asp"
end if
if password="" then
response.redirect "index.asp"
end if
if username="admin" and password="admin" then
response.cookies("adminok")=true
response.redirect "manage.asp"
else
response.redirect "index.asp"
end if
%>
- 文章作者: 福州军威计算机技术有限公司
军威网络是福州最专业的电脑维修公司,专业承接福州电脑维修、上门维修、IT外包、企业电脑包年维护、局域网网络布线、网吧承包等相关维修服务。
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处 、作者信息和声明。否则将追究法律责任。
TAG:
评论加载中...
|