
求简单ASP代码 提交用户发表文章总数2
<!--#includefile="mdb.asp"--><%mofei=trim(request.form("mofei"))ifmofei=""thenRespons...
<!--#include file="mdb.asp"-->
<%
mofei=trim(request.form("mofei"))
if mofei="" then
Response.Write ("<script language=javascript>alert('验证码不能为空!');this.location.href='login.asp';</script>")
response.end
end if
if cstr(session("getcode"))<>cstr(mofei) then
Response.Write ("<script language=javascript>alert('验证码输入有误请核对!');this.location.href='login.asp';</script>")
response.end
end if
action=request("action")
memo=request("memo")
if memo="" then
memo="无"
end if
title=CheckStr(trim(request.form("title")))
username=request("username")
url=request("url")
if url="" then
url="无"
end if
yl_time=now()
classname=request("classname")
leibie=request("leibie")
if action="add_wz" then
if title="" or username="" or leibie="" then
Response.Write ("<script language=javascript>alert('表单填写不完整!');this.location.href='login.asp';</script>")
Response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open "select title from detail where title='"&title&"'",conn,1,1
if rs.eof and rs.bof then
'证明没重复
else
response.Write"<script language=javascript> alert(""非常感谢)"");history.go(-1)</script>"
end if
rs.close
set rs=nothing
if Session("lastaddedwz")<>title then
set rss=server.createobject("adodb.recordset")
rss.open "select * from detail",conn,1,3
rss.addnew
rss("title")=title
rss("url")=url
rss("classid")=leibie
rss("username")=username
rss("memo")=memo
rss("yl_time")=now()
rss("verity")=1
rss.update
rss.close
set rss=nothing
Session("lastaddedwz")=title
Response.Write ("<script language=javascript>alert('你 的文章已经成功提交!感谢你的支持!');this.location.href='weishen.asp';</script>")
Response.End
end if
end if
%>
我想要的是,给该会员增加文章发表总数量+1在另一张表 “user” 里面,
大概是是这样的 我不懂怎么加 呵呵
rss.open "select * from user where username=会员名",conn,1,3
rss.addnew
rss("wzzs")=wzzs+1
如果 该会员名 在 表 “user” 里面 不存在,则创建它 ,并将文章发表总数量+1
请高手指点 谢谢了
麻烦给我一个直接能用的代码
不需要我修改
谢谢了 展开
<%
mofei=trim(request.form("mofei"))
if mofei="" then
Response.Write ("<script language=javascript>alert('验证码不能为空!');this.location.href='login.asp';</script>")
response.end
end if
if cstr(session("getcode"))<>cstr(mofei) then
Response.Write ("<script language=javascript>alert('验证码输入有误请核对!');this.location.href='login.asp';</script>")
response.end
end if
action=request("action")
memo=request("memo")
if memo="" then
memo="无"
end if
title=CheckStr(trim(request.form("title")))
username=request("username")
url=request("url")
if url="" then
url="无"
end if
yl_time=now()
classname=request("classname")
leibie=request("leibie")
if action="add_wz" then
if title="" or username="" or leibie="" then
Response.Write ("<script language=javascript>alert('表单填写不完整!');this.location.href='login.asp';</script>")
Response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open "select title from detail where title='"&title&"'",conn,1,1
if rs.eof and rs.bof then
'证明没重复
else
response.Write"<script language=javascript> alert(""非常感谢)"");history.go(-1)</script>"
end if
rs.close
set rs=nothing
if Session("lastaddedwz")<>title then
set rss=server.createobject("adodb.recordset")
rss.open "select * from detail",conn,1,3
rss.addnew
rss("title")=title
rss("url")=url
rss("classid")=leibie
rss("username")=username
rss("memo")=memo
rss("yl_time")=now()
rss("verity")=1
rss.update
rss.close
set rss=nothing
Session("lastaddedwz")=title
Response.Write ("<script language=javascript>alert('你 的文章已经成功提交!感谢你的支持!');this.location.href='weishen.asp';</script>")
Response.End
end if
end if
%>
我想要的是,给该会员增加文章发表总数量+1在另一张表 “user” 里面,
大概是是这样的 我不懂怎么加 呵呵
rss.open "select * from user where username=会员名",conn,1,3
rss.addnew
rss("wzzs")=wzzs+1
如果 该会员名 在 表 “user” 里面 不存在,则创建它 ,并将文章发表总数量+1
请高手指点 谢谢了
麻烦给我一个直接能用的代码
不需要我修改
谢谢了 展开
2个回答
展开全部
可能你已经做出来了吧,你是思路是对的:
rss.open "select * from user where username=会员名",conn,1,3
if rss.eof then
'新用户
rss.addnew
rss("wzzs")=1
else
rss("wzzs")=rss("wzzs")+1
end if
rss.update
rss.open "select * from user where username=会员名",conn,1,3
if rss.eof then
'新用户
rss.addnew
rss("wzzs")=1
else
rss("wzzs")=rss("wzzs")+1
end if
rss.update
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
set rs=server.createobject("adodb.recordset")
sql="select * from user where username=会员名"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
sql1="insert into 会员表(user) values ("&会员名&")"
conn.execute sql1
end if
rs.close
set rs=nothing
sql2="update 会员表 set wzzs=wzzs+1 where username=会员名"
conn.execute sql2
conn.close
set conn=nothing
sql="select * from user where username=会员名"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
sql1="insert into 会员表(user) values ("&会员名&")"
conn.execute sql1
end if
rs.close
set rs=nothing
sql2="update 会员表 set wzzs=wzzs+1 where username=会员名"
conn.execute sql2
conn.close
set conn=nothing
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询