📄 post.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" %><%@ include file="../include/config.jsp" %><%@ include file="../include/global.jsp" %><%@ include file="../include/dbUtil.jsp" %><%@ include file="../include/dbConnect.jsp" %><%@ include file="../include/fieldGroup.jsp" %><%! int ni=7; String pageLocation="您的位置: <a href='../common/main.php' class=w>酷网首页</a>>>"+navi[ni];%><%boolean isDebug=isDebug(request,false);DBConnect dbCon=new DBConnect(dbString,dbClass,dbUser,dbPswd);try{ //每页显示的留言条数! int pageSize=10; //存放留言的表名 String tableName="web_gbook"; String action=request.getMethod(); if(action.equals("POST")){ String name=request.getParameter("name"); String subject=request.getParameter("subject"); String content=request.getParameter("content"); String mail=request.getParameter("mail"); String webSite=request.getParameter("webSite"); String theQQ=request.getParameter("oicq"); String theIP=request.getRemoteAddr(); String theDate=getDateAndTime(null); String strSQL=" insert into "+tableName+" (gbk_name,gbk_subject,gbk_content,gbk_mail,gbk_webSite,gbk_qq,gbk_ip,gbk_date) " +"values ('"+name+"','"+subject+"','"+content+"','"+mail+"','"+webSite+"','"+theQQ+"','"+theIP+"','"+theDate+"')"; if(dbCon.doUpdate(strSQL)>0){ if(isDebug){ out.println("Saved OK!*"+content+"*<br>"); out.println("Saved OK!*"+replaceContent(content)+"*"); } else response.sendRedirect("./index.jsp"); } else{ if(isDebug)out.println(strSQL); else alertPage(response,7003,null); } } else{ //String strSQL="select * from "+tableName; //FieldGroup fd=new FieldGroup(dbCon,strSQL);%><%@ include file="../include/header.jsp" %><!--Page Start--><table bgcolor="" "#ffffff" width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td nowrap align=center width=""><p style="line-height:180%"> <font color=navy>首先感谢你的留言,你的每一句话我都会仔细阅读!!!</font> </td></tr> <tr><td align=center bgcolor=#007CD3 colspan=5 height=25><font color=fffff><p style="line-height:160%;font-size:10pt"><b>请您留言<b></font></td></tr> <tr><td align=center><br><br> <form action="<%=request.getRequestURI()%>" method="post"> <table> <tr> <td>您的大名:</td><td><input type="text" name="name" value="" size="78"></td> </tr> <tr> <td>OICQ号码:</td><td><input type="text" name="oicq" value="" size="78"></td> </tr> <tr> <td>电子邮件: </td><td><input type="text" name="mail" value="" size="78"></td> </tr> <tr> <td>个人主页:</td><td><input type="text" name="webSite" value="http://" size="78"></td> </tr> <tr><td> 主题:</td><td><input type="text" name="subject" size="78" ></td> </tr> <tr><td> 内容:</td><td><textarea name="content" cols="77" rows="15" ></textarea></td> </tr> <tr> <td colspan=2 align=center><br><br> <input type="submit" value="完成留言" style="border:1px dotted #111111; border-collapse: collapse; color:#000000; background-color: #EFEFEF"> <!--input type="reset" value="重新来过" style="border:1px dotted #111111; border-collapse: collapse; color:#000000; background-color: #EFEFEF"--> <input type=button value="查看留言" onclick="location.href='./index.jsp'" style="border:1px dotted #111111; border-collapse: collapse; color:#000000; background-color: #EFEFEF"> </td> </tr> </table> </form> <br></td></tr></table><!--Page End--><%@ include file="../include/footer.jsp" %><%}}catch(Exception e){alertPage(response,7775,e.toString());}finally{dbCon.close();}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -