⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add.jsp

📁 不错的留言本 主要功能:   ·支持UBB;   ·屏蔽HTML;   ·加入表情;   ·发言
💻 JSP
📖 第 1 页 / 共 2 页
字号:
                <TD width="20%" height=32 align=right bgcolor="#f1f1f1" class=tablebody3><IMG 
                  src="images/images/perinfo.gif" width="48" height="48" border=0></TD>
                <TD width="80%" height=32 bgcolor="#e1ebba" class=tablebody2><B>个人信息</B></TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" height=19 align=right bgcolor="#f1f1f1" class=tablebody3>您的称呼:</TD>
                <TD width="80%" height=19 bgcolor="#e1ebba" class=tablebody2> 
                  <INPUT maxLength=80 
                  size=19 name=username>
                  <B>&nbsp;<font color="#FF0000">必填</font></B></TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" 
                height=19 align=right vAlign=top bgcolor="#f1f1f1" class=tablebody3>性别及头像:</TD>
                <TD width="80%" height=19 bgcolor="#e1ebba" class=tablebody2>男性:<IMG height=30 
                  src="images/smallface/small_1.gif" width=30> 
                  <INPUT type=radio 
                  CHECKED value=1 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG 
                  height=30 src="images/smallface/small_2.gif" width=30> 
                  <INPUT 
                  type=radio value=2 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG 
                  height=30 src="images/smallface/small_3.gif" width=30> 
                  <INPUT 
                  type=radio value=3 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG 
                  height=30 src="images/smallface/small_4.gif" width=30> 
                  <INPUT 
                  type=radio value=4 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG 
                  height=30 src="images/smallface/small_5.gif" width=30> 
                  <INPUT 
                  type=radio value=5 name=userface> <BR>
                  女性:<IMG height=30 
                  src="images/smallface/small_6.gif" width=30> 
                  <INPUT type=radio 
                  value=6 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_7.gif" width=30> 
                  <INPUT type=radio 
                  value=7 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_8.gif" width=30> 
                  <INPUT type=radio 
                  value=8 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_9.gif" width=30> 
                  <INPUT type=radio 
                  value=9 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_10.gif" width=30> 
                  <INPUT type=radio 
                  value=10 name=userface> <BR>
                  中性:<IMG height=30 
                  src="images/smallface/small_11.gif" width=30> 
                  <INPUT type=radio 
                  value=11 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_12.gif" width=30> 
                  <INPUT type=radio 
                  value=12 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_13.gif" width=30> 
                  <INPUT type=radio 
                  value=13 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_14.gif" width=30> 
                  <INPUT type=radio 
                  value=14 name=userface>
                  &nbsp;&nbsp;&nbsp; <IMG height=30 
                  src="images/smallface/small_15.gif" width=30> 
                  <INPUT type=radio 
                  value=15 name=userface> <P>提示:如果不想透露自己的性别,可以选一个中性的头像</P></TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" height=19 align=right bgcolor="#f1f1f1" class=tablebody3>个人主页:</TD>
                <TD width="80%" height=19 bgcolor="#e1ebba" class=tablebody2> 
                  <INPUT maxLength=80 
                  size=19 value=http:// 
                  name=userurl> <BR>
                  如果要填写,应填写完整地址,如http://www.jspsky.com</TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" 
                height=19 align=right bgcolor="#f1f1f1" class=tablebody3>Email:</TD>
                <TD width="80%" height=19 bgcolor="#e1ebba" class=tablebody2> 
                  <INPUT maxLength=80 
                  size=19 name=usermail>
                  <B><font color="#FF0000">必填</font></B></TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" height=19 align=right bgcolor="#f1f1f1" class=tablebody3>QQ:</TD>
                <TD width="80%" height=19 bgcolor="#e1ebba" class=tablebody2> 
                  <INPUT maxLength=80 
                  size=19 name=userqq></TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" height=35 align=right bgcolor="#f1f1f1" class=tablebody3><IMG 
                  src="images/images/lwcontent.gif" width="41" height="42" border=0></TD>
                <TD width="80%" height=35 bgcolor="#e1ebba" class=tablebody2><B>留言内容</B></TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" height=19 align=right bgcolor="#f1f1f1" class=tablebody3>标题:</TD>
                <TD width="80%" height=19 bgcolor="#e1ebba" class=tablebody2> 
                  <INPUT 
                  maxLength=100 size=40 name=usertitle>
                  <B>&nbsp;<font color="#FF0000">必填</font></B></TD>
              </TR>
              <TR bgcolor="#FFFFFF"> 
                <TD width="20%" 
                height=160 align=right vAlign=top bgcolor="#f1f1f1" class=tablebody3>正文:</TD>
                <TD width="80%" height=160 bgcolor="#e1ebba" 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>&nbsp; 
                <a href="javascript:" onClick="CurObjTime()"><img src="images/ubb/date.gif" alt="插入日期" width="20" height="20" border="0"></a> 
                <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>&nbsp; 
                <a href="javascript:" onClick="addURL()"><img src="images/ubb/link.gif" alt="加入超链接" width="20" height="20" border="0"></a>&nbsp; 
                <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>
              <TR bgcolor="#FFFFFF"> 
                <TD 
                height=21 colSpan=2 align=middle vAlign=center class=tablebody1> 
                  <INPUT type=submit value="提 交" name=Submit> &nbsp;&nbsp; <INPUT type=reset value="清 除" name=Submit2>
                  &nbsp;&nbsp; 
                  <input name="checkButton" type="button" id="checkButton" onClick="checkLength()" value="查看文章长度"> 
                </TD>
              </TR>
          </TABLE>
        </DIV>
      </FORM></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="bian">
  <tr> 
    <td style="BORDER-TOP: #969696 1px solid; FILTER: progid:DXImageTransform.Microsoft.Gradient(startColorStr='#5581D2', endColorStr='#FFFFFF', gradientType='1'" ><div align="right" class="f12"><font color="#333333">版权所有:WWW.JSPSKY.COM</font>&nbsp;&nbsp;<br>
      </div></td>
  </tr>
</table>
</body>
</html>
<%
}
else
{
  String username=request.getParameter("username");
  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");
  String content=request.getParameter("content");
  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 + -