国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

用密碼保護頁面 (II)

2019-11-18 22:25:08
字體:
來源:轉載
供稿:網友
英文原文


現在我們創建查詢語句,可以驗證在表單中輸入的內容是否與數據庫中的內容相一致。

<%@ Language=VBScript %>
<% Response.Buffer = True %>

<HTML>
<BODY>

<% session("allow") = True %>

<%
UserName = Request.Form("username")
PassWord = Request.Form("password")
'grab the form contents

Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "your connection string here"

SQL = "Select * From tblLogin"
Set RS = MyConn.Execute(SQL)

If UserName = RS("UserName") AND Password = RS("Password") Then
'if there is a match then show the page
%>


Put the contents of your page here.

<%
Else
Response.Redirect "http://www.yourdomain.com/login.asp"
RS.Close
MyConn.Close
Set RS = Nothing
Set MyConn = Nothing
End If
%>
'if there was no match then make the visitor try again to login.

</BODY>
</HTML>


把含上述代碼的文件命名為login.asp  


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阿拉善盟| 阳城县| 大新县| 衢州市| 巩义市| 浮梁县| 泰安市| 清镇市| 崇文区| 吕梁市| 文水县| 商洛市| 永德县| 田阳县| 泰州市| 龙海市| 财经| 惠州市| 兰西县| 巍山| 沾益县| 垦利县| 巴马| 石台县| 商洛市| 富阳市| 乐安县| 松阳县| 庐江县| 延寿县| 瑞昌市| 肥东县| 营口市| 广河县| 洛隆县| 胶州市| 上饶县| 上饶县| 凤阳县| 抚远县| 大石桥市|