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

📄 g_savepost.asp

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

titleimg=Checkstr(Request.Form("Expression"))
title=Checkstr(trim(request.Form("subject")))
content=Checkstr(trim(request.form("Content")))
postuser=Checkstr(trim(request.Form("postuser")))
if memberword=trim(request.Form("password")) then
	PassWord=Checkstr(trim(request.Form("password")))
else
	PassWord=md5(Checkstr(trim(request.Form("password"))))
end if
if chkpost=false then
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交发言。"
	FoundErr=True
end if
if postuser="" or PassWord="" then
	postuser=membername
	PassWord=memberword
end if
if postuser="" 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(21)) then
	ErrMsg=ErrMsg+"<Br>"+"<li>发言内容不得大于" & CSTR(txl_set(21)) & "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(13))=1 then
	Errmsg=Errmsg+"<br>"+"<li>班级留言已经被管理员限制了不允许发表留言。"
	founderr=true
	exit sub
end if

rem 保存贴子信息
sql="insert into gbook (rootid,postuser,postuserid,titleimg,title,content,addtime,replytime,istop) values (0,'"&postuser&"',"&userid&",'"&titleimg&"','"&title&"','"&content&"',now(),now(),'0')"
conn.execute(sql)

conn.execute("update [user] set bookcount=bookcount+1,usermoney=usermoney+"&txl_user(6)&" where userid="&userid)
conn.execute("update config set GbookNum=GbookNum+1")
%>
<meta http-equiv=refresh content="3;URL=g_index.asp">
<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 align=center>
<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="g_index.asp">班级留言</a></li>
</ul></td>
</tr>
</table>
<br>
</td>
</tr>
</table>
<%
end sub
%>

⌨️ 快捷键说明

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