📄 add.jsp
字号:
<td height="35">
<div align="center">
<input type="radio" name="userface" value="9">
</div></td>
<td height="35" >
<div align="center"><img src="images/9.gif" width="70" height="70"></div></td>
<td height="35">
<div align="center">
<input type="radio" name="userface" value="10">
</div></td>
<td height="35" >
<div align="center"><img src="images/10.gif" width="70" height="70"></div></td>
<td height="35">
<div align="center">
<input type="radio" name="userface" value="11">
</div></td>
<td height="35" >
<div align="center"><img src="images/11.gif" width="70" height="70"></div></td>
<td height="35">
<div align="center">
<input type="radio" name="userface" value="12">
</div></td>
<td height="35" >
<div align="center"><img src="images/12.gif" width="70" height="70"></div></td>
</tr>
<tr align="center" valign="middle">
<td height="35">
<input type="radio" name="userface" value="13"></td>
<td height="35" ><img src="images/13.gif" width="70" height="70"></td>
<td height="35">
<input type="radio" name="userface" value="14"></td>
<td height="35" ><img src="images/14.gif" width="70" height="70"></td>
<td height="35">
<input type="radio" name="userface" value="15"></td>
<td height="35" ><img src="images/15.gif" width="70" height="70"></td>
<td height="35">
<input type="radio" name="userface" value="16"></td>
<td height="35" ><img src="images/16.gif" width="70" height="70"></td>
</tr>
<tr align="center" valign="middle">
<td height="35">
<input type="radio" name="userface" value="17"></td>
<td height="35" ><img src="images/17.gif" width="70" height="70"></td>
<td height="35">
<input type="radio" name="userface" value="18"></td>
<td height="35" ><img src="images/18.gif" width="70" height="70"></td>
<td height="35">
<input type="radio" name="userface" value="19"></td>
<td height="35" ><img src="images/19.gif" width="70" height="70"></td>
<td height="35">
<input type="radio" name="userface" value="20"></td>
<td height="35" ><img src="images/20.gif" width="70" height="70"></td>
</tr>
</table>
<div align="center"></div>
<div align="center"></div>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="450" class="font">
<tr>
<td>
<div align="center">::::::::::::::::::::::::::::::
留 言 内 容 :::::::::::::::::::::::::::::</div>
</td>
</tr>
<TR bgcolor="#FFFFFF">
<TD width="80%" height=160 bgcolor="#ECE9D8" class=tablebody2>
<select name="selectFont" id="selectFont" onChange="setFont(this.options[this.selectedIndex].value)">
<option selected>选择字体</option>
<option value="宋体">宋体</option>
<option value="黑体">黑体</option>
<option value="隶书">隶书</option>
<option value="幼圆">幼圆</option>
<option value="仿宋_GB2312">仿宋_GB2312</option>
<option value="Arial">Arial</option>
<option value="Times New Roman">Times New Roman</option>
</select> <select name="selectSize" id="selectSize" onChange="setSize(this.options[this.selectedIndex].value)">
<option selected>字体大小</option>
<option value="6">6</option>
<option value="8">8</option>
<option value="10">10</option>
<option value="12">12</option>
<option value="14">14</option>
<option value="18">18</option>
<option value="24">24</option>
<option value="36">36</option>
</select> <select name="selectColor" id="selectColor" onChange="setColor(this.options[this.selectedIndex].value)">
<option value="" selected>选择颜色</option>
<option value="red">红色</option>
<option value="blue">蓝色</option>
<option value="yellow">黄色</option>
<option value="green">绿色</option>
</select> <br>
<a href="javascript:" onClick="addBold()"><img src="images/ubb/bold.gif" alt="字体加粗" width="20" height="20" border="0"></a>
<a href="javascript:" onClick="addEm()"><img src="images/ubb/italic.gif" alt="字体倾斜" width="20" height="20" border="0"></a>
<img src="images/ubb/separator.gif" width="6" height="20"> <a href="javascript:" onClick="addLeft()">
<img src="images/ubb/left.gif" alt="字体左对齐" width="20" height="20" border="0"></a>
<a href="javascript:" onClick="addCenter()"> <img src="images/ubb/center.gif" alt="字体居中" width="20" height="20" border="0"></a>
<a href="javascript:" onClick="addRight()"> <img src="images/ubb/right.gif" alt="字体靠右" width="20" height="20" border="0"></a>
<img src="images/ubb/separator.gif" width="6" height="20"> <a href="javascript:" onClick="addimages()"><img src="images/ubb/image.gif" alt="引用外部图片" width="20" height="20" border="0"></a>
<img src="images/ubb/date.gif" alt="插入日期" width="20" height="20">
<img src="images/ubb/separator.gif" width="6" height="20"> <a href="javascript:" onClick="addQuote()"><img src="images/ubb/quote.gif" alt="插入引用" width="20" height="20" border="0"></a>
<a href="javascript:" onClick="addURL()"><img src="images/ubb/link.gif" alt="加入超链接" width="20" height="20" border="0"></a>
<a href="javascript:" onClick="addEmail()"><img src="images/ubb/email.gif" alt="插入Email" width="20" height="20" border="0"></a>
<BR>
<textarea name="content" cols="70" rows="15" wrap="VIRTUAL" class="form" id="content" style="background-color:#E4E4E4"></textarea>
<BR>
点击表情符号可以将其加入正文(正文内容不能大于<B>600</B>个字符)。<BR>
<script type="text/javascript" language="javascript">
for(var i=0;i<20;i++)
{
if(i<10)
{
document.write("<a href=\"javascript:\" onClick=\"addMood(\':em0"+i+"\')\"><img src='images/ubbface/0"+i+".gif' border=0></a>");
}
else
{
document.write("<a href=\"javascript:\" onClick=\"addMood(\':em"+i+"\')\"><img src='images/ubbface/"+i+".gif' border=0></a>");
}
}
</script> <br>
<div id="ch"> <br>
</div>
</TD>
</TR>
</table>
<div align="center"></div>
<table border="0" cellspacing="0" cellpadding="0" width="450" height="40" align="center" >
<tr>
<td align="center" class="font"> <span >
<input type="submit" class=button2 value="写好了" name="Submit">
</span> <span > </span></td>
<td align="center" class="font"> <span >
<input type="button" value="不写了" name="cmdExit" class=button2 onClick=" history.back()">
</span></td>
</tr>
</table>
</td>
</tr>
</form>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td bgcolor=#9ac7cf height=1></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<jsp:include page="bottom.htm" />
</body>
</html>
<%
}
else
{
String username=request.getParameter("username");
byte b[]=username.getBytes("ISO-8859-1");
username=new String(b);
String userface=request.getParameter("userface");
String userurl=request.getParameter("userurl");
String usermail=request.getParameter("usermail");
String userqq=request.getParameter("userqq");
String usertitle=request.getParameter("usertitle");
byte c[]=usertitle.getBytes("ISO-8859-1");
usertitle=new String(c);
String content=request.getParameter("content");
byte d[]=content.getBytes("ISO-8859-1");
content=new String(d);
String ip=request.getRemoteAddr();
java.util.Date date=new java.util.Date();
String datetime=new Timestamp(date.getTime()).toString();
HTMLFilter.setSource(content);
HTMLFilter.run();
content=HTMLFilter.getResult();
UbbCode.setSource(content);
UbbCode.run();
content=UbbCode.getResult();
FaceFilter.setSource(content);
FaceFilter.run();
content=FaceFilter.getResult();
String sql="insert into Guestbook(username,userface,userurl,usermail,userqq,usertitle,content,ip,mydate) values('"+username+"','"+userface+"','"+userurl+"','"+usermail+"','"+userqq+"','"+usertitle+"','"+content+"','"+ip+"','"+datetime+"')";
try{
stmt.executeUpdate(sql);
response.sendRedirect("index.jsp");
}catch(Exception e)
{
response.sendRedirect("error.jsp?error=2");//数据库更新出错!
}
}
if(conn!=null)
{
conn.close();
}
if(stmt!=null)
{
stmt.close();
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -