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

📄 b_savepost.asp

📁 此文件为一个电子同学录
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/chkinput.asp" -->
<%
dim titleimg,title,content
dim signflag,mailflag
dim rootid

titleimg=Checkstr(Request.Form("Expression"))
title=Checkstr(trim(request.Form("subject")))
content=Checkstr(trim(request.form("Content")))
realname=Checkstr(trim(request.Form("realname")))
if memberword=trim(request.Form("password")) then
	PassWord=Checkstr(trim(request.Form("password")))
else
	PassWord=md5(Checkstr(trim(request.Form("password"))))
end if
if signflag="yes" then
	signflag=1
else
	signflag=0
end if
if mailflag="yes" then
	mailflag=1
else
	mailflag=0
end if
if chkpost=false then
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交发言。"
	FoundErr=True
end if
if realName="" or PassWord="" then
	realname=membername
	PassWord=memberword
end if
if realName="" then
	ErrMsg=ErrMsg+"<Br>"+"<li>请输入您的姓名。"
	FoundErr=True
end if
if title="" then
	FoundErr=True
	ErrMsg=ErrMsg+"<Br>"+"<li>帖子的主题不应为空。"
elseif strLength(title)>50 then
	FoundErr=True
	ErrMsg=ErrMsg+"<Br>"+"<li>帖子主题长度不能超过50"
end if
if strLength(content)>Clng(txl_set(22)) then
	ErrMsg=ErrMsg+"<Br>"+"<li>发言内容不得大于" & CSTR(txl_set(22)) & "bytes"
	FoundErr=true
end if
if content="" then
	ErrMsg=ErrMsg+"<Br>"+"<li>没有填写内容。"
	FoundErr=true
end if
'保存
if founderr then
	call head()
	call head_var("","")
	call txl_error()
else
	stats="发表话题成功"
	call head()
	call head_var(0,0)
	call main()
	if founderr then call txl_error()
end if
call foot()

sub main()
if Cint(txl_set(14))=1 then
	Errmsg=Errmsg+"<br>"+"<li>班级论坛已经被管理员限制了不允许发表新话题。"
	founderr=true
	exit sub
end if

rem 保存贴子信息
sql="insert into Topic (postuser,postuserid,titleimg,title,addtime,LastTime,hits,replys,istop,isbest,islock) values ('"&realname&"',"&userid&",'"&titleimg&"','"&title&"',now(),now(),'0','0','0','0','0')"
conn.execute(sql)

set rs=conn.execute("select top 1 topicid from topic order by topicid desc")
rootid=rs(0)

sql="insert into bbs (rootid,postuser,postuserid,titleimg,title,content,addtime,isbest,signflag,emailflag) values ("&rootid&",'"&realname&"',"&userid&",'"&titleimg&"','"&title&"','"&content&"',now(),0,"&signflag&","&mailflag&")"
conn.execute(sql)

conn.execute("update [user] set bbscount=bbscount+1,usermoney=usermoney+"&txl_user(2)&" where userid="&userid)
conn.execute("update config set BbsNum=BbsNum+1")
%>
<meta http-equiv=refresh content="3;URL=b_show.asp?id=<%=rootid%>">
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">  
<tr> 
<td  bgcolor=<%=txl_body(10)%>><br>
<table cellpadding=3 cellspacing=1 align=center class=tableborder1 style="width:75%">
<tr>
<th width="100%">状态:<%=stats%></th>
</tr>
<tr>
<td width="100%" class=tablebody1>本页面将在3秒后自动返回班级你所发表的话题,<b>您可以选择以下操作:</b><br><ul>
<li><a href="index.asp">返回首页</a></li>
<li><a href="b_index.asp">班级论坛</a></li>
<li><a href="b_show.asp?id=<%=rootid%>">您所发表的帖子</a></li>
</ul></td>
</tr>
</table>
<br>
</td>
</tr>
</table>
<%
end sub
%>

⌨️ 快捷键说明

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