2007-03-30

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

来源: 本站收集整理 作者:佚名 评论 0 条
 

好久没有写过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")
共3页: 上一页 1 [2] [3] 下一页

(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:AJAX技术 vs 传统的ASP无刷新技术  
下一篇:关于bin.base64和bin.hex和urlencode的编码比较及ASP解码
    评论加载中…
 推荐文章
     

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号