一个ASP程序前台显示产品有错误的问题!请关注帮忙

jessejiang 2007-11-28 09:21:55
ASP网站程序,在后台[分类产品管理]有1.2.3大类,前台当然就相应有1.2.3栏目查看。
下级有[产品管理]其中发布了10个产品,归属1大类!这时前台显示正常!

当你在后台修改了其中一个产品后,前台点击1栏目,发现只显示9个产品了,很奇怪为什么会这样?到底那里出错?

目前解决办法是,在后台[分类产品管理]中,点击1大类栏目的[修改],不做动作,直接[确定修改],返回前台1栏目又正常显示10个产品了。

大家能看明白我说的吗?
很想解决这个问题,请教大家了。
...全文
24 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
jessejiang 2007-11-29
大家实际看看吧

http://www.vinajewellery.com

看看英文左边栏的 Bracelets (有193个产品。)显示才10个产品,错误!
在看中文左边栏的 Bracelets (有193个产品。)正常显示

为什么会这样?
目前解决办法是,在后台[分类产品管理]中,点击1大类栏目的[修改],不做动作,直接[确定修改],返回前台1栏目又正常显示10个产品了。

大家能明白我说的问题了吧?
回复
jessejiang 2007-11-29
附上一个关键文件代码,个人发现关键在195行,看到底哪里有问题了:



<!--#include file="conn.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/error.asp"-->
<!--#include file="check1.asp"-->
<!--#include file="inc/pro_body.asp"-->
<title>产品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
dim founderr,errmsg
founderr=false
errmsg=""

if session("admin_flag")<>"into" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='login.asp' target='_parent' >重新登录</a>!"
Call diserror()
response.End
else
dim sql_test,rs_test
sql_test="select * from p_class"
set rs_test=server.createobject("adodb.recordset")
rs_test.open sql_test,conn,1,1
if rs_test.BOF and rs_test.EOF then
rs_test.close
set rs_test=Nothing
'coon.close
'set conn=Nothing
founderr=true
errmsg=errmsg+"<br>"+"<li>你还没有输入产品的分类,不能输入产品!请<a href='admin_p.asp?action=newp' target='_self' >加入新类</a>!"
Call diserror()
response.End
End if


dim p_name,p_spec,upfile,p_epitome,p_class_id,p_other

if Request.form("MM_insert") then
if request.form("action")="newpro" then

dim evs,evs_sql,evs_rs
evs_sql="select count(p_id) from p_info"
set evs_rs=conn.execute(evs_sql)
if Not(evs_rs.bof or evs_rs.eof) then
if evs_rs(0)>10000 then
Response.redirect("admin_pro.asp")
response.end()
end if
evs_rs.close
set ev_rs=nothing
end if
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
sql="select * from p_info"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
p_name=trim(replace(request.form("p_name"),"'",""))
p_spec=trim(replace(request.form("p_spec"),"'",""))
p_pic=trim(replace(request.form("p_pic"),"'",""))
p_epitome=trim(replace(request.form("p_epitome"),"'","’"))
p_small_type=trim(replace(request.form("p_small_type"),"'",""))
p_type=trim(replace(request.form("p_type"),"'",""))
p_other=trim(replace(request.form("p_other"),"'",""))
p_jianjie=trim(replace(request.form("p_jianjie"),"'",""))
p_name_e=trim(replace(request.form("p_name_e"),"'",""))
p_spec_e=trim(replace(request.form("p_spec_e"),"'",""))
p_epitome_e=trim(replace(request.form("p_epitome_e"),"'","’"))
p_jianjie_e=trim(replace(request.form("p_jianjie_e"),"'",""))
if p_other="" then
rs("p_other")=0
else
rs("p_other")=1
End if
if p_name="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品名称!"
else
rs("p_name")=p_name
End if
if p_spec="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品的型号!"
else
rs("p_spec")=p_spec
End if
if p_pic="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品的图片!"
else
rs("p_pic")=p_pic
End if
if p_type="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品的大分类!"'else
else
rs("p_type")=p_type
End if
'由P_type,p_small_type 得到p_type_e和p_small_tyPe_e
sql_p="select p_type_e,p_small_type_e from p_class_small where p_type='"&p_type&"' and p_small_type='"&p_small_type&"'"
set rs_p=server.createobject("adodb.recordset")
rs_p.open sql_p,conn,1,1
if Not(rs_p.BOF and rs_p.EOF) then
p_type_e=rs_p("p_type_e")
p_small_type_e=rs_p("p_small_type_e")
end if
rs_p.close
set rs_p=nothing

rs("p_small_type")=p_small_type
rs("p_epitome")=p_epitome '详细说明
rs("p_jianjie")=p_jianjie'简单说明
'英文方面
rs("p_name_e")=p_name_e
rs("p_spec_e")=p_spec_e
rs("p_epitome_e")=p_epitome_e
rs("p_small_type_e")=p_small_type_e
rs("p_type_e")=p_type_e
rs("p_jianjie_e")=p_jianjie_e

if Not founderr then
rs.update
rs.close
set rs=Nothing
closedatabase
Response.write "<script language = 'javascript'>alert('成功添加一个产品!');window.document.location.href='admin_pro.asp';</script>"
response.end
else
Call diserror()
response.End
End if
End if
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
if request.form("action")="editpro" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
if Not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的id参数。"
End if
End if
if founderr then
Call diserror()
response.End
End if
sql="select * from p_info where p_id="&cint(request.Form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
p_name=trim(replace(request.form("p_name"),"'",""))
p_spec=trim(replace(request.form("p_spec"),"'",""))
'upfile=trim(replace(request.form("upfile"),"'",""))
p_pic=trim(replace(request.form("p_pic"),"'",""))
p_epitome=trim(replace(request.form("p_epitome"),"'","’"))
p_small_type=trim(replace(request.form("p_small_type"),"'",""))
p_type=trim(replace(request.form("p_type"),"'",""))
p_other=trim(replace(request.form("p_other"),"'",""))
p_jianjie=trim(replace(request.form("p_jianjie"),"'",""))
p_order=trim(replace(request.form("p_order"),"'",""))
p_name_e=trim(replace(request.form("p_name_e"),"'",""))
p_spec_e=trim(replace(request.form("p_spec_e"),"'",""))
p_epitome_e=trim(replace(request.form("p_epitome_e"),"'","’"))
p_small_type_e=trim(replace(request.form("p_small_type_e"),"'",""))
p_type_e=trim(replace(request.form("p_type_e"),"'",""))
p_jianjie_e=trim(replace(request.form("p_jianjie_e"),"'",""))

if p_other="" then
rs("p_other")=0
else
rs("p_other")=1
End if
if p_name="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品名称!"
else
rs("p_name")=p_name
End if
if p_spec="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品的型号!"
else
rs("p_spec")=p_spec
End if
if p_pic="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品的图片!"
else
rs("p_pic")=p_pic
End if
if p_type="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入产品的大分类!"'else
else
rs("p_type")=p_type
End if
'由P_type,p_small_type 得到p_type_e和p_small_tyPe_e
sql_p="select p_type_e,p_small_type_e from p_class_small where p_type='"&p_type&"' and p_small_type='"&p_small_type&"'"
set rs_p=server.createobject("adodb.recordset")
rs_p.open sql_p,conn,1,1
if Not(rs_p.BOF and rs_p.EOF) then
p_type_e=rs_p("p_type_e")
p_small_type_e=rs_p("p_small_type_e")
end if
rs_p.close
set rs_p=nothing

rs("p_small_type")=p_small_type
rs("p_epitome")=p_epitome '详细说明
rs("p_jianjie")=p_jianjie'简单说明
rs("p_order")=p_order
'英文方面
rs("p_name_e")=p_name_e
rs("p_spec_e")=p_spec_e
rs("p_epitome_e")=p_epitome_e
rs("p_small_type_e")=p_small_type_e
rs("p_type_e")=p_type_e
rs("p_jianjie_e")=p_jianjie_e

if Not founderr then
rs.update
rs.close
set rs=Nothing
Response.write "<script language = 'javascript'>alert('成功修改了此产品!');window.document.location.href='admin_pro.asp';</script>"
response.end
else
Call diserror()
response.End
End if
End if
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
if request.form("action")="delpro" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
if Not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的id参数。"
End if
End if
if founderr then
Call diserror()
response.End
End if
sql="select * from p_info where p_id="&cint(request.Form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=Nothing
closedatabase
Response.write "<script language = 'javascript'>alert('成功删除此产品!');window.document.location.href='admin_pro.asp';</script>"
response.end
End if
End if

Call adminpro_body()
closedatabase
End if
%>
回复
yanniu008 2007-11-28
......
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2007-11-28 09:21
社区公告
暂无公告