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

📄 add.jsp

📁 该留言本采用JSP+JavaBean+Access开发
💻 JSP
📖 第 1 页 / 共 2 页
字号:

                                  </tr>
                                  <tr align="center" valign="middle"> 
                                    <td height="35"> 
                                      <div align="center"> 
                                        <input type="radio" name="userface" value="5">
                                      </div></td>
                                    <td height="35" > 
                                      <div align="center"><img src="images/5.gif" width="70" height="70"></div></td>
                                    <td height="35"> 
                                      <div align="center"> 
                                        <input type="radio" name="userface" value="6">
                                      </div></td>
                                    <td height="35" > 
                                      <div align="center"><img src="images/6.gif" width="70" height="70"></div></td>
                                    <td height="35"> 
                                      <div align="center"> 
                                        <input type="radio" name="userface" value="7">
                                      </div></td>
                                    <td height="35" > 
                                      <div align="center"><img src="images/7.gif" width="70" height="70"></div></td>
                                    <td height="35"> 
                                      <div align="center">
                                        <input type="radio" name="userface" value="8">
                                      </div></td>
                                    <td height="35" > 
                                      <div align="center"><img src="images/8.gif" width="70" height="70"></div></td>

                                  </tr>
                                  <tr align="center" valign="middle"> 
                                    <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"><hr align="center" class="high1">
                        </div>
                        <table border="0" cellspacing="0" cellpadding="0" align="center"  width="450" class="font">
                          <tr> 
                            <td> 
                              <div align="center" class="STYLE3">留 言 内 容 </div>                            </td>
                          </tr>
              <TR bgcolor="#FFFFFF"> 
                <TD width="80%" height=160 bgcolor="#ECE9D8" class=tablebody2> 
                  
                    <div align="left">
                      <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; 
                      <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>&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>
                      <span class="STYLE4">点击表情符号可以将其加入正文(正文内容不能大于<B>600</B>个字符)。</span><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>
                    <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>
  </div>
  </DIV>
</DIV>
<DIV class=pageContent>
<DIV class=page style="FLOAT: right">
<UL>
  <LI class=pageNumber><STRONG>
  1
  </STRONG></LI></UL></DIV></DIV></DIV>
<DIV id=mainContent-bottomimg></DIV></DIV></DIV>
<%@ include file="sidebar.jsp" %>
<DIV style="CLEAR: both; DISPLAY: block; FONT: 0px/0px sans-serif"></DIV><!--底部-->
<DIV id=foot>
<P><span class="STYLE1">Powered By <A href="http://www.qipeng.net.cn/" 
target=_blank><STRONG>齐鹏网络</STRONG></A> CopyRight 2007, 
  <STRONG>有朝一日虎归山,我要血染半边天---齐鹏</STRONG> <A 
href="http://validator.w3.org/check/referer" target=_blank>xhtml</A> | <A 
href="http://jigsaw.w3.org/css-validator/validator-uri.html">css</A></span></P>
<P style="FONT-SIZE: 15px"><span class="STYLE1">欢迎大家来到我的IT博客,<a href="http://www.qipeng.net.cn">www.qipeng.net.cn</a></span><BR>
</P>
</DIV></DIV>
</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 + -