📄 add_notice.asp
字号:
<!--#include file="mycheck.asp"-->
<%sub add_notice()
if userid<>"" then
if request("title")="" then
error_html=error_html&"<li>公告主题也忘了填?不是吧?</li>"
end if
if request("tittle")<>"" and len(request("title"))>messagemax then
error_html=error_html&"<li>本留言服务规定,公告公告主题字数不能超过 50 个字,谢谢!"
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
if session("user")="" then
response.write("<meta HTTP-EQUIV='REFRESH' CONTENT='0;URL=?user="&request("user")&"'")
end if
set rs_notice=server.createobject("adodb.recordset")
sql_notice="select * from notice where userid="&userid&""
rs_notice.open sql_notice,conn,3,2
if rs_notice.recordcount>pagesize then
error_html=error_html&"<li>对不起,你的公告不能超过 "&pagesize&" 条,谢谢!</li>"
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
rs_notice.addnew
writetime=now()
rs_notice("writetime")=writetime
rs_notice("title")=request("title")
rs_notice("message")=request("type")&request("message")
rs_notice("userid")=userid
rs_notice("name")=name
rs_notice.update
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&"&action=read_notice'> 请等待 系统正在处理你的公告信息..... <br> 发表成功,3秒后我们将带你返回这个留言本的首页.<br> 如果系统没有反应请按下面的链接返回留言板!<p><br> [<a href=?user="&user&"&action=read_notice>返回公告板</a>] </td></tr></table>"
table(addok_html)
end if
end if
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -