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

📄 mbsave.asp

📁 睿网留言版 2004 v1.0
💻 ASP
字号:
<!--#include file="conn.inc"-->
<%
dim adminmail
dim adminname
dim counter
dim adminhomepage
dim logout
dim title
dim bgcolor1
dim background1
dim bianchuang
dim maxperpage
dim banquan
dim zhizuo
dim pss
set rs1=server.createobject("adodb.recordset")
sql1="select * from admin where id=1"
rs1.open sql1,conn,1,3
adminmail=rs1("adminemail")
adminname=rs1("adminname")
title=rs1("title")
pss=rs1("pss")
background1="image/"&rs1("background1")
adminhomepage=rs1("adminhomepage")
banquan=rs1("banquan")
zhizuo=rs1("zhizuo")
if instr(1,zhizuo,"realnet",1)=0 then
 zhizuo="程序制作:<a href=mailto:realnet@realnet.cn>realnet</a>"
 rs1("zhizuo")=zhizuo
end if
rs1.update


rs1.close
set rs1=nothing
%>
<%
'读入数据
dim name
dim email
dim from
dim pubsee
dim serpass
dim homepage
dim qq
dim sign
dim subject
dim content
dim pic
dim ip
dim face
dim dateandtime
name=Server.HtmlEncode(request.form("name"))
email=Server.HtmlEncode(request.form("email"))
from=Server.HtmlEncode(request.form("from"))
pubsee=request.form("pubsee")
serpass=Server.HtmlEncode(request.form("serpass"))
homepage=Server.HtmlEncode(request.form("homepage"))
qq=request.form("qq")
sign=Server.HtmlEncode(request.form("sign"))
subject=Server.HtmlEncode(request.form("subject"))
content=Server.HtmlEncode(request.form("content"))
pic=request.form("pic")
ip=request.ServerVariables("REMOTE_ADDR")
face=request.form("p1")+request.form("p2")
if request.form("p1")="" or request.form("p2")="" then
face="m01"
end if
nowtime=now()
dateandtime=cstr(year(nowtime))+"-"+cstr(month(nowtime))+"-"+cstr(day(nowtime))+" "+cstr(hour(nowtime))+":"+right("0"+cstr(minute(nowtime)),2)+":"+right("0"+cstr(second(nowtime)),2)
%>

<%
'错误判断
if name="" or name="站长" or name=adminname then
error=error&"姓名不能空或姓名不能为站长"&" ."
end if
if email<>"" then
 if IsValidEmail(email)=false then
   error=error&"邮件地址书写错误"&" ."
 end if
else
 email=""
end if
if pss=1 then
 if pubsee<>"0" and serpass="" then
    error=error&"不公开留言需要填写密码"&" ."
  end if
end if
if pss=0 then 
 pubsee="0"
 serpass=""
end if
if homepage="http://" then
 homepage=""
end if
if not IsNumeric(qq) and qq<>"" then
 error=error&"oicq必须是数字"&" ."
end if
if qq="" then
 qq="没有或者不告诉!"
end if
if sign="" then
 sign="这人懒没留下什么"
end if
if subject="" then 
 error=error&"主题不能为空"&" ."
end if
if content<>"" and request.cookies("content")=content then
 error=error&"不要给我相同的留言"&" ."
end if
if content="" then
 error=error&"留言内容不能空"&" ."
end if
if error<>"" then
    Conn.Close
    Set conn = nothing
    response.write("<script>alert('" & error & "');history.go(-1)</script>")
    response.end
end if
if from="" then
 from="未知"
end if
%>

<%
response.cookies("content")=content '内容写入cookies
'写入数据库
set rs=server.createobject("adodb.recordset")
sql="select * from book where id=null"

rs.open sql,conn,3,2
rs.addnew
rs("name")=name
rs("email")=email
rs("from")=from
rs("single")=pubsee
rs("replypass")=serpass
rs("homepage")=homepage
rs("oicq")=qq
rs("sign")=sign
rs("subject")=subject
rs("content")=content
rs("ip")=ip
rs("dateandtime")=dateandtime
rs("face")=face
rs("pic")=pic
rs.update


rs.close
set rs=nothing  
conn.close     
set conn=nothing
%>
<%
for i=1 to 9
response.write("<br>")
next
response.write("<center>")
response.write("<font color=red>你的留言成功!请关闭本窗口")
response.write("<br>如有问题请与站长联系")
response.write("<br><a href=mailto:"&adminmail&">"&adminmail&"</a>")
response.write("</center>")
%><head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>写留言</title>
<meta http-equiv='content-type' content='text/html; charset=gb2312'>
</head>

⌨️ 快捷键说明

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