📄 add_msg.asp
字号:
<!--#include file="ip.asp"-->
<!--#include file="mycheck.asp"-->
<%function add_msg()
if request("userid")="" then
userid=0
else
userid=request("userid")
end if
if session("rewrite")=1 then
error_html="<li>不好意思,发表过的帖子可不能重发,谢谢!</li>"
end if
if request("name")="" then
error_html="<li>您得填写您的名字哦!</li>"
end if
if request("email")<>"" and IsValidEmail(request("email"))=false then
error_html=error_html&"<li>呵呵,您的电子邮件是不是错了?请查!</li>"
end if
if request("qq")<>"" and isInteger(request("qq"))=false then
error_html=error_html&"<li>对不起,您所填写的 QQ number不是数字哦,这样是不行的!</li>"
end if
if request("qq")<>"" and len(request("qq"))<4 then
error_html=error_html&"<li>好像没有小于4位number的QQ吧!</li>"
end if
if request("qq")<>"" and len(request("qq"))>10 then
error_html=error_html&"<li>好像还没有超过10位number的QQ吧!</li>"
end if
if request("message")="" then
error_html=error_html&"<li>留言不说是不行的!一定要说两句哦!</li>"
end if
if request("message")<>"" and len(request("message"))>messagemax then
error_html=error_html&"<li>本留言服务规定,留言字数不能超过 "&messagemax&" 字,谢谢!"
end if
if error_html<>"" then
error_html=error_html&"<p align=center>[<a href=javascript:history.go(-1);>这里返回</a>]</p>"
error_html="<table width=100% height=151 border=1 cellspacing=0 cellpadding=3 bordercolorlight=#333333 bordercolordark=#FFFFFF> <tr> <td width='100%' height='6' class=link > "&error_html&"</td></tr></table>"
table(error_html)
else
messageid= dateID
timenow=now()
from_address=address(Request.ServerVariables("REMOTE_ADDR"))
'response.write messageid
sql_msg="insert into message (id,userid,name,email,qq,homepage,message,writetime,pic,from_address) values ("&messageid&","&userid&",'"&request("name")&"','"&request("email")&"','"&request("qq")&"','"&request("homepage")&"','"&request("type")&" "&request("message")&"','"&timenow&"','"&request("pic")&"','"&from_address&"')"
set rs_msg=conn.execute(sql_msg)
session("rewrite")=1
Response.Cookies("Uming")("name") = request("name")
Response.Cookies("Uming")("qq") = request("qq")
Response.Cookies("Uming")("email") = request("email")
Response.Cookies("Uming")("homepage") = request("homepage")
Response.Cookies("Uming").Expires = dateadd("d","365",date())
Response.Cookies("Uming").path=cookiepath
addok_html="<table width=100% height=151 border=1 cellspacing=0 cellpadding=3 bordercolorlight=#333333 bordercolordark=#FFFFFF> <tr> <td width='100%' height='6' class=link align=center><meta HTTP-EQUIV='REFRESH' CONTENT='3;URL=?user="&user&"'> 请等待 系统正在处理你的留言信息..... <br> 留言成功,3秒后我们将带你返回这个留言本的首页.<br> 如果系统没有反应请按下面的链接返回留言本!<p><br> [<a href=?user="&user&">返回我的留言本</a>] </td></tr></table>"
table(addok_html)
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -