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

📄 putout_ok.asp

📁 C2C二手交易网SMRUC v2.0 全部实现了C2C电子商务功能。 特别适合高校、组织、社区实现自己的C2C电子商务。 C2C二手交易网SMRUC v2.0具有强大的用户自主发布和管理信息功能
💻 ASP
字号:
<!-- #include file="conn.asp" -->
<!-- #include file= "function.asp" -->

<%
  if session("user")="" then
  response.redirect "index.asp"
  end if
%>

<%
user=session("user")
kind=request.form("kind")
bclass=request.form("bclass")
sclass=request.form("sclass")
title=ReplaceBadChar(request.form("title"))
price=ReplaceBadChar(request.form("price"))
intro=ReplaceBadChar(request.form("intro"))
expiredays=request.form("expiredays")
pic=request.form("pic")
ifpush=request.form("ifpush")
if ifpush = "push" then
	ifpush = 1
else
	ifpush = 0
end if
phone=ReplaceBadChar(request.form("phone"))
nowtime=date()

if bclass="" then
%>
<SCRIPT Language=javascript>
	<!--
		window.alert("请选择类别!!!");
	-->
</SCRIPT>
<%
response.redirect("putout.asp")
end if
if sclass="" then
%>
<SCRIPT Language=javascript>
	<!--
		window.alert("请选择类别!!!");
	-->
</SCRIPT>
<%
response.redirect("putout.asp")
end if
if price="" then
price=0
end if
if title="" then
title="[无标题]"
end if
if intro="" then
intro="[无内容]"
end if
if phone="" then
phone="[无]"
end if


set rs=server.createobject("adodb.recordset")
sql = "insert into [info] (info_user,info_title,info_kind,info_bclass,info_sclass,info_price,info_intro,info_expiredays,info_phone,info_status,info_date,info_pic,info_push) values ('"&user&"','"&title&"','"&kind&"',"&bclass&","&sclass&","&price&",'"&intro&"',"&expiredays&",'"&phone&"','有效','"&nowtime&"','"&pic&"','"&ifpush&"')"
conn.execute(sql)
sql = "select top 1 * from [info] order by info_id desc"
rs.Open sql,conn,1,1
nowid = rs("info_id")
rs.close

set rs=server.createobject("adodb.recordset")
sql = "select bclass_amount from bclass where bclass_id="&bclass
rs.Open sql,conn,1,1
set amount=rs("bclass_amount")
amount=amount+1
rs.close

sql = "update bclass set bclass_amount="&amount&" where bclass_id="&bclass
conn.execute(sql)


sql = "select sclass_amount from sclass where sclass_id="&sclass
rs.Open sql,conn,1,1
set amount=rs("sclass_amount")
amount=amount+1
rs.close

sql = "update sclass set sclass_amount="&amount&" where sclass_id="&sclass
conn.execute(sql)

sql="update config set info_count=info_count+1"
conn.execute(sql)

if kind = "供" then
	oppotype = "求"
else
	oppotype = "供"
end if
sql = "select * from info where info_kind='"&oppotype&"' and info_push=1"
rs.Open sql,conn,1,1
do while not rs.eof
	if correlation(title,rs("info_title")) = 1 then
		sql2="insert into piece (piece_content,piece_sender,piece_reciever,piece_time,piece_isread) values('系统信息推送服务,找到以下你可能需要的信息<br>点击标题查看: <a href=showinfo.asp?id="&nowid&">"&title&"</a>','system','"&rs("info_user")&"','"&now()&"','否')"
		conn.execute(sql2)
		sql2="update config set piece_count=piece_count+1"
		conn.execute(sql2)
		if ifpush = 1 then
			sql2="insert into piece (piece_content,piece_sender,piece_reciever,piece_time,piece_isread) values('系统信息推送服务,找到以下你可能需要的信息<br>点击标题查看: <a href=showinfo.asp?id="&rs("info_id")&">"&rs("info_title")&"</a>','system','"&user&"','"&now()&"','否')"
			conn.execute(sql2)
			sql2="update config set piece_count=piece_count+1"
			conn.execute(sql2)
		end if
	end if
	rs.movenext
loop
rs.close

sql="update [user] set user_infocount=user_infocount+1 where user_name='"&user&"'"
conn.execute(sql)
%>
<SCRIPT Language=javascript>
	<!--
		window.alert("提交成功!!!");
		location.replace("putout.asp");
	-->
</SCRIPT>

⌨️ 快捷键说明

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