ASP 密碼驗證篇

來源:互聯網
上載者:User
下面的程式是阿喔動感管理通用程式,非常簡單不用解釋了吧!
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="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">
 
<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
%>


作者:阿喔 出處:<ASP動感線上> http://asp.on.net.cn/

(待續)



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.