然后那个loginadmin.asp代码是
<!-- #include file="conn.asp" -->
<%
if Request("username")="" then
%>
<script language=Javascript>
alert("用户名不能为空!");
window.history.go(-1);
</script>
<%
response.End
end if
sql="select * from admin where username='" & trim(request("username")) & "' and password='" & replace(trim(request("password")),"'","''") & "'"
'response.write sql
'response.End
set rs = conn.Execute(sql)
if not (rs.eof or err) then
session("username")=rs("username")
if session("oldUrl")<>"" then
response.redirect session("oldUrl")
else
response.redirect "admin_index.asp"
end if
else
%>
<script language=Javascript>
alert("用户名或密码错误,请重新输入!");
window.history.go(-1);
</script>
<%
end if
%>