主要代码如下:
<%
theuser=Request("Jname")
thepassword=Request("Jpwd")
Set chklink=Server.CreateObject("ADODB.Connection")
chklink.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("../image.mdb")
Set backinf=Server.CreateObject("ADODB.Recordset")
Set backinf.ActiveConnection=chklink
sqlstr="SELECT pageurl from judges where (Jname='"&theuser&"') and (Jpwd='"&thepassword&"')"
backinf.Open sqlstr,chklink,1,3
if not backinf.EOF then
response.Write trim(backinf("pageurl"))
response.Write "<br>"
Response.Write("您好,尊敬的用户 "&theuser&" !欢迎登录!正在连接到您的主页“"&backinf("pageurl")&"”,请稍候……")
Response.Write("<script language='javascript' type='text/javascript'>")
Response.Write("targeturl='"&backinf("pageurl")&"'")
Response.Write("</script>")
else
Response.Write("<center>对不起,您输入的用户名或者密码有误!请您重新仔细输入!<br><br>")
Response.Write("<a href=javascript:history.go(-1)>点击这里返回登录界面!</a></center>")
end if
%>
<body>
</body> |