英文原文
现在我们创建查询语句,可以验证在表单中输入的内容是否与数据库中的内容相一致。
<%@ Language=V cript %>
<% Re o e.Buffer = True %>
<HTML>
< ODY>
<% Se ion("allow") = True %>
<%
UserName = Request.Form("username")
Pa word = Request.Form(" a word")
'grab the form contents
Set MyCo =Server.CreateObject("ADODB.Co ectio quot;)
MyCo .Open "your co ection string here"
SQL = " elect * From tblLogi quot;
Set RS = MyCo .Execute(SQL)
If UserName = RS("UserName") AND Pa word = RS(" a word") Then
'if there is a match then show the page
%>
Put the contents of your page here.
<%
Else
Re o e.Redirect "http://www.yourdomain.com/login.a quot;
RS.Close
MyCo .Close
Set RS = Nothing
Set MyCo = Nothing
End If
%>
'if there was no match then make the visitor try again to login.
</BODY>
</HTML>
把含上述代码的文件命名为login.a
an>


