asp 验证登陆

来源:百度知道 编辑:UC知道 时间:2024/06/17 16:46:59
网页里ASP没登陆的时候这样的警告后转向,现在我想改为登陆了弹警告该怎么改
<%
dim rsmoney
set rsmoney=conn.execute("select * from usersinfo where username='"&session("login_user")&"'")
if session("login_user")="" then
response.write "<script>alert('请您先登录系统!操作失败(Err=0402)');window.location=('../Default.asp')</script>"
response.end
end if
%>

把window.location后面加个href
window.location.href='../default.asp'这样就OK了.

if session("login_user")="" then
response.write "<script>alert('请您先登录系统!操作失败(Err=0402)');window.location=('../Default.asp')</script>"
response.end
else
response.write "<script>alert('您已经登录了!');</script>"
response.end
end if