📄 replysms.jsp
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="checkbbsuser.jsp"%>
<%@ include file="../inc/conn.jsp"%>
<%
String sql,sender,accepter,title,content;
String touser = new String(request.getParameter("touser").getBytes("iso-8859-1"));
String act = request.getParameter("act");
String id = request.getParameter("id");
if(act!=null)
{
sender=(String)session.getAttribute("name");
accepter=touser;
title=new String(request.getParameter("title").getBytes("iso-8859-1"));
content=new String(request.getParameter("content").getBytes("iso-8859-1"));
sql="insert into sms(title,content,sender,accepter) values('"+title+"','"+content+"','"+sender+"','"+accepter+"')";
stmt.executeUpdate(sql);
sql="update sms set replysign=1 where id='"+id+"'";
stmt.executeUpdate(sql);
out.print("<script language='javascript'>");
out.print("alert('发送成功!');");
out.print("history.go(-2);");
out.print("</script>");
out.close();
stmt.close();
conn.close();
}
else
{
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/xmwuye.css" rel=stylesheet type=text/css>
<title>论坛短信系统</title>
</head>
<script language="javascript">
<!--
function check(form)
{
if (form.title.value=="")
{
alert("请填写标题!");
form.title.focus();
return false;
}
if (form.content.value=="")
{
alert("请填写内容!");
form.content.focus();
return false;
}
return true;
}
//-->
</script>
<body topmargin="5">
<div align="center">
<TABLE align=center bgColor=#a4b6d7 border=0 cellPadding=0 cellSpacing=0 width="99%">
<TR>
<TD height=25> <div align="center"><font color="#FFFFFF"><strong>欢迎<font color="#CC3300"><%=session.getAttribute("name")%></font>网友回复短信</strong></font></div></TD>
</TR>
</TABLE>
<TABLE align="center" bgColor="#a4b6d7" border=0 cellPadding=0 cellSpacing=0 width="99%">
<TBODY>
<TR bgColor=#f2f8ff>
<TD height="28" vAlign=middle bgColor=#b1d6fa class=font10_5>
<div align="center">回复短信</div></TD>
</TR>
</TBODY>
</TABLE>
<TABLE width="99%" border=0 align="center" cellPadding=0 cellSpacing=0 bgColor="#FFFFFF">
<TBODY>
<TR bgColor=#f2f8ff>
<TD vAlign=middle bgColor=#f6f6f6 class=font10_5><div align="center">
<form name="form2" method="post" action="" style="MARGIN-BOTTOM: 0px" onsubmit="return check(this)">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="17%" height="30"> <div align="right">标题:</div></td>
<td width="83%"><input name="title" type="text" id="title" size="50"></td>
</tr>
<tr>
<td height="25"><div align="right">内容:</div></td>
<td><textarea name="content" cols="70" rows="20" id="content"></textarea></td>
</tr>
<tr>
<td height="30"><div align="right"></div></td>
<td><input type="submit" name="Submit2" value="发送"> <input name="cannel" type="reset" id="cannel" value="重置">
<input name="act" type="hidden" id="act" value="y"> <input name="id" type="hidden" id="id" value="<%=id%>">
<input name="touser" type="hidden" id="touser" value="<%=touser%>">
</td>
</tr>
</table>
</form>
</div></TD>
</TR>
</TBODY>
</TABLE>
<script language="JavaScript" src="../inc/bbstail.js"></script>
</div>
</body>
</html>
<%}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -