⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminlog.asp

📁 ASP+SQL Server动态网站开发从基础到实践教程
💻 ASP
字号:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>


<% if Request.Form("enter") = "yes" then 

Dim C, RS, Query

'create connection
Set C = Server.CreateObject("ADODB.Connection")
C.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & server.MapPath ("../fpdb/engglas.mdb")    

'create recordset
Set RS = Server.CreateObject("ADODB.Recordset")

'sql to open data...
Query = "Select * from usr where " & _
        "username = '" & Request.form("Username") & "' and " & _
        "password = '" & Request.form("Password") & "'"
        
'open recordset        
RS.Open Query, c

'wrong pass/user...!
if RS.EOF and RS.BOF then
  Response.Write "<p align=""center""><font color=""red"" face=""verdana"" size=""2"">Wrong password or username !</font></p>"
else
'login ok !
  Session("login") = "yes"
  Response.Redirect "admintit.asp"
end if

RS.Close
Set RS = Nothing
C.Close
Set C = Nothing

end if

%>


<p align="center">
<font face="verdana" size="2">

<form method="POST" action="adminlog.asp">
<div align="center">
<b>管理员登录</b><br></br>
<table border="1" cellpadding="0" cellspacing="0" width="300" style="border-collapse: collapse" bordercolor="#000000">
<tr>
<td>
<table border="0" width="300" cellspacing="0" cellpadding="5" bgcolor="#ADD8E6">
  <tr>
    <td width="80" valign="top" align="left">
   <p><font face="Verdana" size="2">用户名 :</font></td>
    <td><input type="text" name="Username" size="20"></td>
  </tr>
  <tr>
    <td width="80"><font face="Verdana" size="2">密&nbsp; 码 :
    </font></td>
    <td><input type="password" name="Password" size="20"></td>
  </tr>
  <tr>
    <td width="80"></td>
    <td><font face="Verdana" size="1">
    <input type="submit" value="登录" name="B1">
    <input type="hidden" value="yes" name="enter">
    </font></td>
  </tr>
</table>
</td>
</tr>
</table>
</center>
</div>
</form>
</font>

<p align="center">用户名:test<br>
密&nbsp; 码:test1</p>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -