登录验证,用户名,密码,验证码验证功能都正常,可转到主页却没显示用户名,请各位老师指点一下,好吗?
这是登录验证页面,loginok.asp,代码如下:请教您啦:请您帮我看看这个页面问题出在哪儿呀?登录验证,用户名,密码,验证码验证功能都正常,可转到主页却没显示用户名,请您指点一下,好吗?
<!--#include file="inc/conn.asp" -->
<%
if Session("GetCode")="" or Session("GetCode") <> UCase(Request.Form("vcode")) then
response.write "<SCRIPT language=JavaScript>alert('验证码错误!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
else
Session("GetCode") = "" '清空Session
Dim rs,sql,uid,pwd,expTime,date_last
uid=Trim(Request.Form("username"))
uid=replace(uid,"'","")
pwd=Trim(Request.Form("password"))
pwd=replace(pwd,"'","")
set rs=server.createobject("adodb.recordset")
sql="select * from admin where name='"&uid&"'and dlpwd1='" &pwd& "'"
rs.open sql,conn,1,1
If rs.Eof and rs.bof Then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<SCRIPT language=JavaScript>alert('用户名或密码错误!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
else
rs.close
set rs=nothing
conn.close
set conn=nothing
response.Redirect("/index.asp")
End If
End If
%>