我的登录界面在输入用户名和密码确认后没有反映,还是原来的状态,不知道是什么原因,希望各位高手不吝赐教,小弟在这感谢了!
我的代码如下:
<%
dim sql
dim rs
dim founduser
dim username
dim password
dim founderr
founderr=false
FoundUser=false
username=trim(request.form("username"))
password=trim(Request.Form("password"))
if username="" then
response.redirect "login.asp?err=1"
end if
if password="" then
response.redirect "login.asp?err=2"
end if
dim conn
dim connstr
connstr="provider=sqloledb;user id= sa;password=sailing;initial catalog=information;data source=(local)"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs=server.createobject("adodb.recordset")
sql="select * from admin where username='"&username&"'"
rs.open sql,conn,1,1
if not rs.eof then
if password=rs("password") then
response.cookies("okadmin")=true
response.redirect "manage.asp"
else
response.redirect "login.asp?err=3"
end if
else
response.redirect "login.asp?err=4"
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>