asp怎样实现用户登录界面

来源:百度知道 编辑:UC知道 时间:2024/05/23 02:12:06
现有一个登录主页index.asp,bangong.asp登录后的页面,数据库文件为psd.mdb,请问怎样实现用户登录界面

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户登录</title>
</head>

<body>
<%
if request("cmd")="login" then
user=request.form("user")
pass=request.form("pass")

Dim Conn
Dim Rs
Dim DbPath
Set Conn=Server.CreateObject("ADODB.Connection")
Set Rs=Server.CreateObject("ADODB.Recordset")
DbPath=Server.Mappath("数据库路径")
Conn.Open ("Provider=Microsoft.OLEDB.JET.4.0;Data Source="& DbPath)
sql="select * from [表名] where [用户字段]='"& user &"'" and [密码字段]='"& pass &"'"
rs.open sql,conn,1,1
if rs.eof then
response.write ("<script language=""javascri