处理页面:

<!--#include file="conn.asp"-->
<%dim username,password
username=trim(request.Form("username"))
password=trim(request.Form("password"))
%>
<%set rs=server.CreateObject("adodb.recordset")
sql4="select * from xtadmin where username='"&username&"'"
rs.open sql4,conn,1,1
if rs.eof and rs.bof then
response.Write ("<script language=javascript>alert('用户名不正确!');history.go(-1)</script>")
else
if rs("password")<>password then
response.Write ("<script language=javascript>alert('密码不正确!');history.go(-1)</script>")
else
response.Cookies("username")=rs("username")
response.Redirect "cg.asp"
rs.close
set rs=nothing
end if
end if%>
<%
conn.close
set conn=nothing
%>

posted on 2006-10-21 22:33  小角色  阅读(166)  评论(0)    收藏  举报