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

📄 buytopic.asp

📁 一个不错的论坛原代码
💻 ASP
字号:
<!--#include file="Connections.asp" -->
<!--#include file="inc_admenu.asp"-->
<!--#include file="conn.asp" -->

<%cpbusername=Request.Cookies(l_url&"feiyue")("Username")
if cpbusername="" then response.redirect"index.asp"
T_id=chktopic(request("t_id"))
l_id=chktopic(request("l_id"))
jmoney=chktopic(request("jmoney"))
username=cpbusername
if t_id="" or l_id="" then
response.write "<script>alert('参数错误,请从帖子列表出提交');history.back();</script>"
response.end
end if
sql="select u_money from user where username='"&username&"'"
set rs=conn.execute(sql)
if not rs.eof then
y_money=rs("u_money")
else
response.write "<script>alert('您不是本论坛用户啊');history.back();</script>"
response.end
end if
if int(jmoney)>int(y_money) then
response.write "<script>alert('您的钱不够啊');history.back();</script>"
response.end
end if
if int(jmoney)<0 then 
response.write "<script>alert('别人倒贴你钱?不是吧');history.back();</script>" 
response.end 
end if 

sql="select t_buysend,t_username from topic where t_id="&t_id&""
set rs=conn.execute(sql)
if not rs.eof then
p_username=rs("t_username")
if username=rs("t_username") then
response.write "<script>alert('呵呵,您要花钱购买自己的帖吗');history.back();</script>"
response.end
end if
t_buysend=rs("t_buysend")
 if not isnull(t_buysend) then
		if instr(t_buysend,username)>0 then
		response.write "<script>alert('呵呵,您已经购买过了');history.back();</script>"
		response.end
		end if
		end if


else
response.write "<script>alert('参数错误,可能此贴不存在或者已经删除');history.back();</script>"
response.end
end if
set rs=nothing
sql= "update topic set t_buysend=t_buysend&'"&username&","&"'  where t_id = "&t_id&""
conn.Execute(sql)
sql="update user set u_money=u_money-"&jmoney&" where username='"&username&"'"
conn.Execute(sql)
sql="update user set u_money=u_money+"&jmoney&" where username='"&p_username&"'"
conn.Execute(sql)

url="topic.asp?t_id="&t_id&"&l_id="&l_id
Response.Redirect(url)


%>

⌨️ 快捷键说明

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