?? login.asp
字號:
<%
Option Explicit
dim conn,DBPath
dim rs_user
dim sql
dim user_name,password
user_name =left(request("user_name"),10)
password =left(request("password"),10)
if password="" or user_name="" then
response.write "<script language='javascript'>"
response.write "alert('數(shù)據(jù)填寫有錯!');"
response.write "history.go(-1);"
response.write "</script>"
response.end
end if
'-----------------------------------------------------------------
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("friend.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'-----------------------------------------------------------------
Set rs_user = Server.CreateObject("ADODB.Recordset")
sql="select * from user_reg where user_name like '" & user_name & "'and password like '" & password & "'"
rs_user.open sql,conn,3,2
if rs_user.eof and rs_user.bof then
%>
<html>
<head>
<style>
<!--
a:link { color: blue; text-decoration: none }
a:visited { color: blue; text-decoration: none }
a:active { color: #ff9966; text-decoration: none }
a:hover { color: red; text-decoration: none }
-->
</style>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>提示信息</title>
</head>
<body>
<div align="center">
<center>
<table border="1" width="400" bordercolor="#000000" cellspacing="0" cellpadding="0" height="120">
<tr>
<td width="100%" bgcolor="#000000" height="16">
<p align="center"><b><font color="#FFFFFF" size="3">錯誤提示</font></b></td>
</tr>
<tr>
<td width="100%" bgcolor="#EEEEEE" height="100">
<p align="center"><font size="2">用戶名或密碼錯誤!</font></p>
<p align="center"><font size="2"><a href="default.asp">[返回]</a></font></td>
</tr>
</table>
</center>
</div>
<p align="center"> <!--Banner-->
<script src="http://www.644000.net/guanggao/banner.asp"></script>
<!--Banner --></p>
</body>
</html>
<%else
session("user_id")=rs_user("user_id")
rs_user.close
set rs_user=nothing
set conn=nothing
response.redirect "your.asp"
response.end
end if%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -