文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > jsp留言板代码
侵权投诉

jsp留言板代码

像我一样的初学者

meter("lw_author").getBytes("ISO
885Array_1"));
pagetitle=new String(request.getParameter("pagetitle").getBytes("ISO
885Array_1"));
author_http=new String(request.getParameter("author_http").getBytes(
"ISO885Array_1"));
author_email=new String(request.getParameter("author_email").getByte
s("ISO885Array_1"));
zt_time=new String(request.getParameter("zt_time").getBytes("ISO885Array
_1"));
zt_author=new String(request.getParameter("zt_author").getBytes("ISO
885Array_1"));
lw_ico=request.getParameter("gifface");

} catch (Exception e) {}

try{
lw_content=new String(request.getParameter("lw_content").getBytes("I
SO885Array_1"));
String requestMethod=request.getMethod();
requestMethod=requestMethod.toUpperCase();
if(requestMethod.indexOf("POST")<0)
{ out.print("非法操作!");
return;
}

//形成其他数据项
author_ip=request.getRemoteAddr() ;
lw_time=testInq.getCurrentDate("yyyyMMddHHmmss");
lw_type=""+"c"; //从贴
answer_num=0;
click_num=0;
//================
st=",";
//保证留言所有数据项的长度在正常范围内
if(lw_title.length()>50) lw_title=lw_title.substring(0,50);
if(lw_author.length()>20) lw_author=lw_author.substring(0,20);
if(author_http.length()>40) author_http=author_http.substring(0,40);

if(author_email.length()>50) author_email=author_email.substring(0,4
0);
if(zt_author.length()>50) zt_author=zt_author.substring(0,40);
if(lw_content.length()>4000) lw_content=lw_content.substring(0,4000)
;

insertsql="insert into guestbook values("+lw_title+st+lw_author+st+
author_http+st+
author_email+st+lw_ico+st+lw_time+","+answer_num+","+cli
ck_num+","+
author_ip+st+lw_class1+st+lw_class2+st+lw_type+st+zt_time
+st+zt_author+st+
lw_content+")";
//out.print(insertsql);
//插入留言
try{
st=testInq.executeUpdate(insertsql);
if(st.indexOf("executeUpdate ok")<0)
out.print("msg="+st);
else
{
updatesql="update guestbook set answer_num=answer_num + 1 "+l
where;
//增加回复人数统计
try{
st=testInq.executeUpdate(updatesql);
if(st.indexOf("executeUpdate ok")<0)
out.print("msg="+st);
}catch (Exception e) { }
}
}catch (Exception e) { out.print("留言出错:"+e);}
} catch (Exception e) {}
%>

<%
//验证留言输入项合法性的javascript
String ljs=" <SCRIPT language=JavaScript> \n"+
" <!-- \n"+
" function ValidInput() \n"+
" {if(document.sign.lw_author.value==\"\") \n"+
" {alert(\"请填写您的大名。\"); \n"+
" document.sign.lw_author.focus(); \n"+
" return false;} \n"+
" if(document.sign.lw_title.value==\"\") \n"+
" {alert(\"请填写留言主题。\"); \n"+
" document.sign.lw_title.focus(); \n"+
" return false;} \n"+
" if (document.sign.author_email.value!=\"\") \n"+
" { if ((document.sign.author_email.value.indexOf(\"@\")<0)//(document
.sign.author_email.value.indexOf(\":\")!=-1)) \n"+
" {alert(\"您

上一页第2页

你可能喜欢

  • 留言板设计与实现
  • 留言板代码
  • 文件上传
  • BBS论坛
  • 文件下载
  • JSP课程设计

热门文档

相关文档

  • jsp留言板源代码

    http://www.chasfz.com jsp 留言板源代码 http://www.chasfz.com oracle 数据表创建. create table guestbook ( lw_title varchar2(100) not null, --...

  • jsp留言板代码

    java.text.SimpleDateFormat" %> 留言板 </...("Refresh","5;url=index.jsp"); %> [新留言]<...

  • JSP设计留言板代码2

    JSP设计留言板代码2_计算机软件及应用_IT/计算机_专业资料。简单的JSP留言板设计代码很有用的jsp留言板源代码(2) guestbook.jsp = jsp留言板源代码(2) ...

  • JSP留言板

    <h1>留言管理范例 ―― JSP + JDBC 实现</h1> <% // 判断是否有错误信息,如果有则打印 // 如果没有此段代码,则显示时会直接打印 null if(request....

  • 网上留言簿jsp实现(附所有代码)

    网上留言簿jsp实现(附所有代码)_计算机软件及应用_IT/计算机_专业资料。网页留言簿的jsp实现,附有全部的jsp代码,用MyEclipse和sqlserver数据库实现,数据库可以是...

  • 基于JSP的留言板课程设计

    Jsp 课程设计报告 JSP 课程设计报告书 —基于 jsp 留言板专 业: 计算机信息...主要的代码如下: <%@ include file="connDB.jsp" %> <% request.set...

  • JSP留言板作业(jdbc+mysql)

    网络留言板系统各功能模块的设计和实现 4.1 用户登陆界面 用户登陆界面如图 5-1 所示: 图 4-1 用户登陆册页面运行效果 用户登陆页面程序“index.jsp”代码...

  • 基于JSP与Mysql的留言板设计

    (4)处理添加留言信息(Addmessage.jsp)模块代码 <% String driverName="com.mysql.jdbc.Driver"; String userName="root"; String userPassword="10086"; Strin...

  • jsp留言板

    jsp留言板源代码 2007-11-29 15:05 oracle数据表创建. create table guestbook ( lw_title varchar2(100) not null, --留言主题 lw_author varchar2(20) ...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email