📄 message.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="errorpage.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="mycss.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<jsp:useBean id="db" class="data.DBConnectionBean"/>
<%
String id=(String)session.getAttribute("id");
if(id!=null){%>
<%
String sqlstr;
Connection conn = db.getopenConnection();
PreparedStatement ps=null;
int num=0;
if (request.getParameter("num")!=null) num=Integer.parseInt(request.getParameter("num"));
if (num!=0)
{
sqlstr="delete from message where num=?";
ps=conn.prepareStatement(sqlstr);
ps.setInt(1,num);
ps.executeUpdate();
%>
<script language="JavaScript">
alert("删除成功!");
</script>
<%
}
%>
<%request.setCharacterEncoding("gb2312");
%>
<body>
<table width="626" height="320" border="1" align="left" bgcolor="#FFFFFF">
<tr>
<td height="23" colspan="2" bgcolor="#996666"> <div align="center" class="STYLE4 STYLE1">快捷操作</div></td>
<td width="489" rowspan="10"><table width="478" height="269" border="0" align="center" cellspacing="0">
<tr>
<td width="512" height="36"><table width="473" height="22" border="1" align="center" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="4" bgcolor="#ECE9D8"><div align="center"><span class="STYLE2">您所收到的消息</span>!</div></td>
</tr>
<tr>
<td width="104" bgcolor="#996666"><div align="center" class="STYLE4 STYLE1">标题</div></td>
<td width="164" bgcolor="#996666"><div align="center" class="STYLE4 STYLE1">时间</div></td>
<td width="100" bgcolor="#996666"><div align="center" class="STYLE4 STYLE1">来自</div></td>
<td width="87" bgcolor="#996666"><div align="center" class="STYLE4 STYLE1">删?</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="24"><table width="476" border="1" align="center" cellspacing="0" bordercolor="#996666">
<% ResultSet rs=db.message(id);
while (rs.next()){
int read=rs.getInt("num");
%>
<tr>
<td width="105"><div align="center"><a href="readmessage.jsp?read=<%=read%>"><%=rs.getString("title") %></a></div></td>
<td width="164"><div align="center"><%=rs.getString("zjtime") %></div></td>
<td width="101"><div align="center"><%=rs.getString("fromid")%></div></td>
<td width="88"><a href="message.jsp?num=<%=read%>">删除<img src="../pic/delet.png" width="12" height="15" /></a></td>
</tr>
<%} %>
</table></td>
</tr>
<tr>
<td height="204"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="20" height="23"><div align="center"><img src="../pic/file.gif" width="16" height="14" /></div></td>
<td width="95"><div align="center"><a href="sendmessage.jsp" target="_self">发送消息</a></div></td>
</tr>
<tr>
<td height="23"><div align="center">
<div align="center"><img src="../pic/file.gif" width="16" height="14" /></div>
</div></td>
<td><div align="center"><a href="serchmessage.jsp">搜索消息</a></div></td>
</tr>
<tr>
<td height="23"><div align="center">
<div align="center"><img src="../pic/file.gif" width="16" height="14" /></div>
</div></td>
<td><div align="center"><a href="zhuyi.jsp">注意事项</a></div></td>
</tr>
<tr>
<td height="49" colspan="2"> </td>
</tr>
<tr>
<td height="23" colspan="2" bgcolor="#996666"><div align="center" class="STYLE4 STYLE1">消息箱</div></td>
</tr>
<tr>
<td height="23"><div align="center"><img src="../pic/file.gif" width="16" height="14" /></div></td>
<td><div align="center"><a href="sendbox.jsp">发件箱</a></div></td>
</tr>
<tr>
<td height="23"><div align="center"><img src="../pic/fileopen.png" width="16" height="14" /></div></td>
<td bgcolor="#ECE9D8"><div align="center"><a href="message.jsp" target="_self">收件箱</a></div></td>
</tr>
<tr>
<td height="23"><div align="center"><img src="../pic/file.gif" width="16" height="14" /></div></td>
<td><div align="center"><a href="friend.jsp">联系人</a></div></td>
</tr>
<tr>
<td height="37" colspan="2"> </td>
</tr>
</table>
<%
}
else
{
%>
<script language="JavaScript">
alert("出错!您还没登陆!点确定返回首页登陆部落....");
</script>
<meta HTTP-EQUIV=REFRESH CONTENT="0;URL=/xunibuluo/index.jsp">
<%
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -