选择显示字体大小

asp简单的ajax留言板(采用三层模式)

好久没有写过asp了,这回写个留言板还真觉得有点难度,竞然写了整整一天,哈哈.
就只有留言其它的都什么也没写,采用三层结构(不知道算不算,本来对三层的概念很糊涂)

演示www.zj55.com的留言板,希望各位大哥大姐如果发现有漏洞的话请在这里告诉我,千万不要黑我的网站,在这里小弟先谢过了.

index.asp
<%@ codepage=65001%>
<%
option explicit
%>
<% response.charset="utf-8"%>
<% session.codepage=65001 %>
<!-- #include file="acchelper.asp" -->
<!-- #include file="common.asp"-->
<!-- #include file="dal_guest.asp" -->
<!-- #include file="mod_guest.asp" -->
<!-- #include file="bll_guest.asp" -->
<%
 dim mybll
 dim mylist
 set mybll = new bll_guest
 select case request("tcmd")
  case "save"
   mybll.insert()
  case "del"
   mybll.delete()
 end select
 mylist = mybll.findbypage()
%>
<h2>客户留言</h2>
<p>
<form name="subform" id="subform">
 <textarea id="con" name="con" cols="56" rows="6" wrap="virtual"></textarea>
 <input type="button" name="submit" value="提交留言" onclick="$('guest/index.asp?tcmd=save&content='+escape(this.form.con.value))" />
</form>
</p>
<%=mylist%>

bll_guest.asp
<%
 '/// <summary>
 '/// 摘要说明。
 '/// </summary>
 class bll_guest

  private mycom,mymod,mydal

  private li,ul

  private del
 
  '获取信息
  public sub getguest()

   mydal.getguest(id)

  end sub

  '新增信息
  public sub insert()
  
   mymod.content = request("content")
   mymod.re = request("re")
   mymod.addtime = now()
   mymod.ip = request.servervariables("http_x_forwarded_for")
   if len(mymod.ip)<=0 then mymod.ip = request.servervariables("remote_addr")

   call mydal.insert(mymod)

  end sub

  '更新信息
  public sub update()

   call mydal.update(mymod)

  end sub

  '删除信息
  public sub delete()

   mydal.delete(request("id"))

  end sub

  '查找信息
  public function findbypage()

   dim pagesize,currentpage,wherevalue,ordervalue,recordcount
   dim objrs
   dim tmp1,tmp2,tmp3,parms,i
   dim tcmd
   tcmd = request("tcmd")
   pagesize = "8"
   currentpage = request("pageno")
   if len(currentpage)<=0 then
    currentpage=1
   end if
   wherevalue = ""
   ordervalue = "id"
   set objrs = mydal.findbypage(pagesize,currentpage-1,wherevalue,ordervalue)
   i = 1
   recordcount = mydal.count(wherevalue)
   do while not objrs.eof
    if tcmd="del" then
     del = "<a href=""?tcmd=del&id="&objrs("id")&""">删除</a>"
    else
     del = ""
    end if
    parms=array(i,objrs("content"),objrs("ip"),objrs("addtime"),del)


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons