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

📄 post.asp

📁 留言 留言本采用asp+access数据结构
💻 ASP
字号:
<%'    ==================================================
'//             粑粑工作室留言本
'//     程序版本:    粑粑工作室留言本 v2.0
'//     技术支持:    www.gongliyi.cn
'//     程序演示:    www.gongliyi.cn/book2
'//     作    者:    龚礼仪(粑粑)
'//     文件信息:    post.asp(留言处理文件)
'//     最后修改:    2008.11.23   
'//     升级修改:    2008.3.12  
'    ==================================================
%>
<!--#include file="include/conn.asp"-->
<!--#include file="include/system.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="ubb.asp"-->

<%
if request("action")="add" then
web=request.form("web")
content= Ubbcode(Replace(HTMLEncode(RemoveHTML(CheckStr(Request.Form("content")))),"'","''"))
user=request.form("user")
code=request.form("code")

if system("email")=1 then
	email=Replace(CheckStr(Request.form("email")),"'","''")
	If email="" then  
	response.write "<script language=javascript>alert('邮件地址不能为空!');history.go(-1)</script>"
	response.end
	end if 
	
	If IsValidEmail(email)=False then 
	response.write "<script language=javascript>alert('邮件地址格式不正确!');history.go(-1)</script>"
	response.end
	end if 
end if 

if system("qq")=1 then
	txtqq=Replace(CheckStr(Request("qq")),"'","''")
	If txtqq=Empty Then txtqq="0"
end if 

if system("code")=1 then
	if code<>session("Code") then 
	response.write "<script language=javascript>alert('验证码错误,请重新输入!');history.go(-1)</script>"
	response.end
	end if
end if

if user="" then 
response.write "<script language=javascript>alert('请输入你的名字!');history.go(-1)</script>"
response.end
end if

if content=""  then 	
response.write "<script language=javascript>alert('内容错误,请重新输入!');history.go(-1)</script>"
response.end
end if
	
Set rs = Server.CreateObject("ADODB.RecordSet")	
sql="SELECT * FROM message"
rs.Open sql, Conn, 1, 3
rs.AddNew

rs("user") = trim(Request("user"))

if system("face")=1 then
rs("face") =Request("face")&".gif"
else
rs("face") ="1.gif"
end if

if system("web")=1 then
rs("web") = trim(Request("web"))
end if
 
if system("email")=1 then
rs("email") = trim(Request("email"))
end if

rs("content") = content

if system("qq")=1 then
rs("qq") = txtqq
end if

if system("show")=1 then
rs("show") = 0
else
rs("show") = 1
end if

if system("toadmin")=1 then
	if request("toadmin")=1 then  
	rs("toadmin")=1
	else
	rs("toadmin")=0
	end if
end if

rs("addtime") = now()
rs("userip")=Request.ServerVariables("REMOTE_ADDR")
rs.Update
set rs = nothing
Response.write ("<script>alert('添加成功!');window.location='index.asp';</script>")
end if
%>



<%
id=request.QueryString("id")
if request("action")="reply" then
web=request.form("web")
content= Ubbcode(Replace(HTMLEncode(RemoveHTML(CheckStr(Request.Form("content")))),"'","''"))
reply= Ubbcode(Replace(HTMLEncode(RemoveHTML(CheckStr(Request.Form("reply")))),"'","''"))
user=request.form("user")

if system("email")=1 then
	email=Replace(CheckStr(Request.form("email")),"'","''")
	If email="" then  
	response.write "<script language=javascript>alert('邮件地址不能为空!');history.go(-1)</script>"
	response.end
	end if 
	
	If IsValidEmail(email)=False then 
	response.write "<script language=javascript>alert('邮件地址格式不正确!');history.go(-1)</script>"
	response.end
	end if 
end if 

if system("qq")=1 then
	txtqq=Replace(CheckStr(Request("qq")),"'","''")
	If txtqq=Empty Then txtqq="0"
end if 


if user="" then 
response.write "<script language=javascript>alert('请输入你的名字!');history.go(-1)</script>"
response.end
end if

if content=""  then 	
response.write "<script language=javascript>alert('内容错误,请重新输入!');history.go(-1)</script>"
response.end
end if
	
Set rs = Server.CreateObject("ADODB.RecordSet")	
sql="SELECT * FROM  message where id="&id
rs.Open sql, Conn, 1, 3


rs("user") = trim(Request("user"))


if system("web")=1 then
rs("web") = trim(Request("web"))
end if
 
if system("email")=1 then
rs("email") = trim(Request("email"))
end if

rs("content") = content

if reply="" then
rs("reply") =0
else
rs("reply") = reply
end if

if system("qq")=1 then
rs("qq") = txtqq
end if

rs("show") =request.form("show")

if system("toadmin")=1 then
	if request("toadmin")=1 then  
	rs("toadmin")=1
	else
	rs("toadmin")=0
	end if
end if

rs("adminname") = session("adminname")
rs("replytime") = now()

rs("userip")=Request.ServerVariables("REMOTE_ADDR")
rs.Update
set rs = nothing
Response.write ("<script>alert('回复成功!');window.location='index.asp';</script>")
end if
%>



<%if request("action")="del" then
id=request.QueryString("id")
set rs=server.CreateObject("adodb.recordset")
sql="select * from message where id="&request("id")&""
rs.open sql,conn,1,3
rs.delete
conn.close
set conn=nothing
response.Write("<script>alert('删除成功,点击返回!');window.location='index.asp';</script>")
end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -