内容不完整,不可以发布信息!求助,急!!!!

youounihao 2010-06-04 07:04:36
<!--#include file="conn.asp"-->
<!--#include file="check_session.asp"-->
<%
a1=trim(request.Form("sel1"))
a2=trim(request.Form("sel2"))
a3=trim(request.Form("sel3"))
yajin_price=trim(request.Form("yajin_price"))
box=trim(request.Form("box"))
pro_count=trim(request.Form("pro_count"))
pro_price=trim(request.Form("pro_price"))
title=trim(request.Form("title"))
intro=trim(request.Form("intro"))
user_code=trim(request.Form("user_code"))
over_time=trim(request.Form("over_time"))
over_time=over_time + date()
service_qq=trim(request.Form("service_qq"))
game_type=trim(request.Form("game_type"))
shenfenzheng=trim(request.Form("shenfenzheng"))
shenfenzheng1=trim(request.Form("shenfenzheng1"))
shenfenzheng2=trim(request.Form("shenfenzheng2"))
if game_type = "" then
game_type = "游戏帐户"
end if
sell_type=trim(request.Form("sell_type"))
saletext=trim(request.Form("saletext"))
yajin=trim(request.Form("yajin"))
if yajin = 1 and yajin_price =0 then

response.write "<Script>alert('您账户里面没有押金,请先充值');location='Javascript:window.history.go(-1);';</script>"
response.End()
end if

if yajin = 1 and int(yajin_price) < 10 then

response.write "<Script>alert('您的押金不足,请先充值');location='Javascript:window.history.go(-1);';</script>"
response.End()

end if

if saletext <> 1 then

response.write "<Script>alert('您没有同意条款');location='Javascript:window.history.go(-1);';</script>"
response.End()

end if

if pro_price="" or title="" or intro="" or over_time="" or service_qq = "" or saletext ="" then

response.write "<Script>alert('内容不完整');location='Javascript:window.history.go(-1);';</script>"
response.End()
end if

if isnumeric(pro_count) = 0 or isnumeric(pro_price) = 0 then
response.write "<Script>alert('价格或者数量不规范');location='Javascript:window.history.go(-1);';</script>"
response.End()
end if

if box <> "" then '有额外表单的时候
box1=split(box,",")
for a=1 to ubound(box1)
if right(box1(a),1) > 0 then '如果是必填项提示
if trim(request.Form(box1(a))) ="" then
response.write "<Script>alert('表单填写不完整');location='Javascript:window.history.go(-1);';</script>"
response.End()
end if

if trim(instr(box1(a),"再次输入")) > 0 then '验证相同项目是否相同
www1=trim(request.Form(replace(box1(a),"再次输入","")))
www2=trim(request.Form(box1(a)))

if trim(www1) <> trim(www2) then
response.write "<Script>alert('请核查相同的必填项目');location='Javascript:window.history.go(-1);';</script>"
response.End()
end if
end if

end if

box_content=box_content&trim(request.Form(box1(a)))&","
next
end if


set rs=server.CreateObject("adodb.recordset")
sql="select * from game "
rs.open sql,conn,3,3

rs.addnew
rs("class_1")=a1
rs("class_2")=a2
rs("class_3")=a3
rs("title")=title
rs("content")=intro
rs("sell_type")=sell_type
rs("sell_type1")=1
rs("pro_count")=pro_count
rs("pro_price")=pro_price
rs("pro_leftcount")=pro_count
rs("shenfenzheng")=shenfenzheng
rs("shenfenzheng1")=shenfenzheng1
rs("shenfenzheng2")=shenfenzheng2
rs("over_time")=over_time
rs("add_time")=now()
rs("game_type")=game_type
rs("is_guohu")=2
if yajin = 1 then
rs("yajin")=10
end if
rs("service_qq")=service_qq
rs("box")=box
rs("add_user")=session("userid")
rs("isnot")=0
rs("user_code")=user_code
rs("box_content")=box_content
rs.update
rs.close

set rs=server.CreateObject("adodb.recordset")
sql="select * from game_box "
rs.open sql,conn,3,3

rs.addnew
rs("class_1")=a1
rs("class_2")=a2
rs("class_3")=a3
rs("title")=title
rs("content")=intro
rs("sell_type")=sell_type
rs("pro_count")=pro_count
rs("pro_price")=pro_price
rs("over_time")=over_time
rs("is_guohu")=is_guohu
rs("add_time")=now()
rs("game_type")=game_type
if yajin = 1 then
rs("yajin")=10
end if
rs("service_qq")=service_qq
rs("box")=box
rs("isnot")=0
rs("add_user")=session("userid")
rs("box_content")=box_content
rs("user_code")=user_code
rs.update
rs.close
if yajin = 1 then
conn.execute("update game_user set all_money = all_money - 10 where user_name ='"&session("userid")&"'")
end if

response.write "<Script>alert('恭喜您!信息发布成功!由我们的专业客服验证您的资料真伪后方可上架,如您的资料提交有误,建议您重新提交!');location='user_index.asp';</script>"
%>











我把这段代码去掉
if pro_price="" or title="" or intro="" or over_time="" or service_qq = "" or saletext ="" then

response.write "<Script>alert('内容不完整');location='Javascript:window.history.go(-1);';</script>"
response.End()
end if


就会出现错误↓
Provider 错误 '80020005'

类型不匹配。

/sale_alipay_a.asp,行 86





请问高手,怎么样我才能把内容脚本不完整去掉也可以发布信息啊!

就算不填什么东西也可以发布信息
...全文
70 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sy_binbin 2010-06-04
  • 打赏
  • 举报
回复
估计你数据库里pro_price这个字段是货币类型或者浮点类型的

当你在页面中不输入pro_price这个表单时,那么pro_price就为空,所以在插入数据库的时候就会出现错误

你判断一下
if pro_price ="" then
pro_price = 0
end if
yunxiang_myx 2010-06-04
  • 打赏
  • 举报
回复
能不能把出错的行标记下啊,
86行要我去数吗?
这样帮你找问题也方便点。
antiking 2010-06-04
  • 打赏
  • 举报
回复
if pro_price="" or title="" or intro="" or over_time="" or service_qq = "" or saletext =""

你注释了,但后面代码有用到。你可以根据地下的类型赋个值就可以通过了。
pro_price、over_time看是什么类型的,不会都是字符串类型吧。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧