level 1
xin080119
楼主
自己做了一个登录验证页面,连接数据库后,登录页面为加密页面,但是账号密码填对了后点登陆就没跳转到加密的登录页面,求解谢谢!代码如下
这是账号密码验证页面的代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
function checkPwd(ID,psd)
dim conn,param,rs
Set conn=server.CreateObject("ADODB.Connection")
param="driver={microsoft access driver (*.mdb)}"
conn.open param &";dbq="&server.mappath("psd.mdb")
sql="select*from passwd where ID='"&ID&"'and psd='"&psd&"'"
set rs=conn.execute(sql)
if rs.eof then
checkpwd=false
else
checkpwd=true
end if
end function
%>
<%
if isEmpty(session("passed")) then session("passed")=false
ID=request("ID")
psd=request("psd")
if ID="" or psd="" then
response.write"请输入你的登录名和密码。"
elseif not checkpwd(ID,psd) then
response.write"用户名或密码填写错误!请检查你的用户名及密码然后再试一次!"
else session("passed")=ture
end if
if not session("passed") then
%>
请您输入您的用户名及密码!
#000000" text="#FFFFFF">
用户登录首页
用户名: 密 码:
<%response.end
end if %>
登录页面也在首行加了
2016年11月28日 13点11分
1
这是账号密码验证页面的代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
function checkPwd(ID,psd)
dim conn,param,rs
Set conn=server.CreateObject("ADODB.Connection")
param="driver={microsoft access driver (*.mdb)}"
conn.open param &";dbq="&server.mappath("psd.mdb")
sql="select*from passwd where ID='"&ID&"'and psd='"&psd&"'"
set rs=conn.execute(sql)
if rs.eof then
checkpwd=false
else
checkpwd=true
end if
end function
%>
<%
if isEmpty(session("passed")) then session("passed")=false
ID=request("ID")
psd=request("psd")
if ID="" or psd="" then
response.write"请输入你的登录名和密码。"
elseif not checkpwd(ID,psd) then
response.write"用户名或密码填写错误!请检查你的用户名及密码然后再试一次!"
else session("passed")=ture
end if
if not session("passed") then
%>
请您输入您的用户名及密码!
#000000" text="#FFFFFF">
用户登录首页
用户名: 密 码:
<%response.end
end if %>
登录页面也在首行加了