天秤座和金牛座:网页编程问题!!请帮帮忙!!

来源:百度文库 编辑:高考问答 时间:2024/05/04 15:01:38
这是管理人员输入密码和名称进入的页面,当管理员要离开时点击”退出(是个图片连接来的)“然后就有一个小窗口弹出来”确认退出网络综合信息办公系统?“ 点击”确定“ 但是点了确定以后就显示不出什么来了。
<!--#include file="check.asp"-->
<!--#include file="opendb.inc"-->
<html><head><title>top</title>
<meta content="text/html; charset=gb2312" http-equiv=Content-Type>
<script>
function logout()
{
if (confirm("确认退出网络综合信息办公系统?"))
{
document.location.href="LOGOUT.ASP";
}
}
</script>

<base target="middle">

</head>
<body bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<table border=0 cellPadding=0 cellSpacing=0 width="100%" height="139">
<tr>
<td> <IMG src="design1.gif" height=90%></td> <td valign=middle><p align=center>
<%
set rs5=server.createobject("adodb.recordset")
sql1="select * from company"
rs5.open sql1,conn,3,2%><font size=6 face=serif><b>
<%=rs5("cname")%>→人事管理系统</td><%
rs5.close
%>
<td align=right><A href="right.htm"
target=main><IMG hspace=10 src="images/t_4.gif"
border=0></a><A
href="help.asp" target=main><IMG hspace=10
src="images/t_5.gif" border=0></a><a target="_self" href="javascript:logout()"><IMG hspace=10
src="images/t_6.gif" border=0></a>这里是不是应该加点什么?如果是要加什么啊??????
</td>
</tr>

<tr bgColor=#276db2>
<td height="35" colspan="3"> <div align="rinht"></div>
<div align="right">
<table width="796" height="30" border="1">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div></td>
</tr>
</table>
</body></html>

其实退出确定以后应该来到这个页面的。。
<%@ LANGUAGE="VBSCRIPT" %>
<% response.buffer=true %>
<!--#include file=OpenDB.inc-->
<%
sql="select * from user where username='"&session("username")&"'"
rs.open sql,conn,3,2
if not rs.eof then
rs("isonline")=False
rs("logout_time")=now()
rs.update
rs.close
conn.close
end if
response.cookies("adminok")=""
response.cookies("guestok")=""
session("userlogin")="false"
session("storage")=0
session("username")=""
response.write "已经退出"
response.redirect "main.asp"
%>
但是就是显示不出来
请问哪里错了!!~~拜托告诉我一声,请解释详细一点。谢谢
首先非常谢谢xuzq的回答
但是如果照你说的做 那就不会执行
<script>
function logout()
{
if (confirm("确认退出网络综合信息办公系统?"))
{
document.location.href="LOGOUT.ASP";
}
}
</script>
这段了 就不会有提示说 “确认退出网络综合信息办公系统?”了!~~~

把下边的保存为一个.asp的文件比如exit.asp

<%

Session.Abandon
response.write"<SCRIPT language=JavaScript>alert('成功退出登录!');"
response.write"this.location.href='index.asp';</SCRIPT>" %>
图片连接exit.asp就可以了
这里index.asp你可换成你想要跳转到的那个页就可以了

恭喜吖 我也在学

<a target="_self" href="javascript:logout()"><IMG hspace=10
src="images/t_6.gif" border=0></a>

改成下面的试试看

<a target="_self" href="#" onclick="javascript:logout()"><IMG hspace=10
src="images/t_6.gif" border=0></a>