回 帖 发 新 帖 刷新版面

主题:请大家帮我看看一段代码,我在数据库中加了一个字段news_from,在网页中调用不了

<!--#include file="Ft_config.asp"--> 
<!--#include file="Ft_conn.asp"--> 
<!--#include file="Ft_format.asp"--> 
<!--#include file="Ft_lib.asp"--> 
<% 
if request.querystring("id")="" then 
 response.redirect("showerr.asp?errmsg=
<li>壁纸ID不能为空,请指定操作对象!</li>") 
 response.end 
end if 
dim csid,csurl,csname,userview,newsfrom 
csid=checksql("壁纸ID",request.querystring("id"),0,8) 
sql="select * from Ft_pic where pic_id="&csid 
set rs=server.createobject("adodb.recordset") 
rs.open sql,conn,1,1 
if rs.eof and rs.bof then 
 response.redirect("showerr.asp?errmsg=
<li>没有此壁纸或此壁纸已删除!</li>") 
 response.end 
 rs.close 
 set rs=nothing 
else 
 csurl=rs("pic_url") 
 csname=rs("pic_name") 
 cscount=rs("pic_count") 
 userview=rs("user_view") 
 [color=FF0000]newsfrom=rs("news_from") [/color]
        moneypay=rs("moneypay") 
 picid=rs("pic_id") 
' sql="update Ft_pic set pic_count = pic_count + 1 where pic_id="&csid 
' conn.execute(sql) 
 rs.close 
 set rs=nothing 
 if instr(csname,"<font color")<>0 then 
   pictitle=split(csname,">") 
   pic_title=replace(pictitle(1),"</font","") 
 else 
  pic_title=csname 
 end if 
 sub_title=pic_title&"-浏览图片" 
end if 
call head() 
call body() 
call foot() 
sub body() 
if request.form("addremark")="true" then 
 call localsubmit() 
 dim remarker,remarker_ip,remark,remark_date 
 remarker=checksql("评论者",request.form("remarker"),1,10) 
 remarker_ip=checksql("评论者IP",request.form("remarker_ip"),1,30) 
 picid=checksql("图片ID",request.form("pic_id"),0,8) 
 remark=checksql("评论内容",request.form("remark"),1,151) 
 if usecode=1 then 
  GetCode=checksql("验证码",request.form("GetCode"),1,6) 
  valicode=Session("yangzeng") 
  if GetCode<>valicode then 
   response.redirect("showerr.asp?errmsg=
<li>验证码错误!") 
   response.end 
  end if 
 end if 
 sql="select * from Ft_pic_remark where pic_id="&picid 
 set rsremark=server.createobject("adodb.recordset") 
 rsremark.open sql,conn,1,3 
 rsremark.addnew 
 rsremark("remarker")=remarker 
 rsremark("remark")=remark 
 rsremark("pic_id")=picid 
 rsremark("remarker_ip")=remarker_ip 
 rsremark("remark_date")=now() 
 rsremark.update 
 rsremark.close 
 set rsremark=nothing 
 Response.Write " <script> alert('您已经成功提交评论信息,感谢您的评论。。。\n\n                                   "& webname &" "& date() &"'); location.href='viewpic.asp?id="&picid&"'</script>" 
 Response.End 
end if 
StrTemp=split(mb_pic,"|||@@@|||") 
dim StrTemp2,Ft_mbstr2 
Ft_mbstr2=replace(StrTemp(1),"$newsfrom$",newsfrom) 在这里调用不出来,整个网页图片显示部分都没了
Ft_mbstr2=replace(StrTemp(1),"$csname$",csname) 
Ft_mbstr2=replace(Ft_mbstr2,"$cscount$",cscount) 
if userview=1 then 
 Ft_mbstr2=replace(Ft_mbstr2,"$userview$","<span class=""key_font"">会员图片</span>&nbsp;<span class=""disable_font"">消费"&moneypay&"个金币</span>") 
elseif userview=2 then 
 Ft_mbstr2=replace(Ft_mbstr2,"$userview$","<span class=""key_font"">VIP会员图片</span>&nbsp;<span class=""disable_font"">消费"&moneypay&"个金币</span>") 
else 
 Ft_mbstr2=replace(Ft_mbstr2,"$userview$","普通图片") 
end if 
if session("WbCpU_adminlogin")=WbCpU_sessionvar then 
 piccontent="<img" src="""&csurl&"""">" 
 sql="update Ft_pic set pic_count = pic_count + 1 where pic_id="&csid 
 conn.execute(sql) 
else 
 if user_system<>0 and userview<>0 then 
  if request.Cookies("userlogin")=user_session then 
   dim userarray,username 
   curarray=split(request.Cookies("userdata"),"||") 
   username=curarray(0) 
   sql="select * from Ft_user where lock=0 and name='"&username&"' and passed=1" 
   set rs2=server.createobject("adodb.recordset") 
   rs2.open sql,conn,1,3 
   if not rs2.eof then 
    if rs2("user_money")<0 then 
     response.write"<script>alert('"&username&",你的金币数已不够,请及时充值!');location.href='index.asp';</script>" 
     response.end 
    elseif userview=2 then 
     if rs2("user_type")<>2 then 
                  response.write"<script>alert('您不是VIP会员,无权查看此页');location.href='index.asp';</script>" 
      response.end 
     else 
      rs2("user_money")=rs2("user_money")-moneypay 
      rs2.update 
     end if 
    elseif userview=1 then 
     rs2("user_money")=rs2("user_money")-moneypay 
     rs2.update 
    end if 
   else 
    response.write"<script>alert('没有此会员或此会员正在审核或此会员已被锁定');location.href='index.asp';</script>" 
    response.end 
   end if 
   rs2.close 
   set rs2=nothing 
   piccontent="<img" src="""&csurl&"""">" 
   sql="update Ft_pic set pic_count = pic_count + 1 where pic_id="&csid 
 conn.execute(sql) 
  else 
   piccontent="
<p align=""center"" class=""disable_font"">你没有权限查看此页,请<a href=""user.asp"">注册</a>为会员……</p>

  end if 
 else 
  piccontent="<img" src="""&csurl&"""">" 
  sql="update Ft_pic set pic_count = pic_count + 1 where pic_id="&csid 
  conn.execute(sql) 
 end if 
end if 
'图片主体表格输出 
Ft_mbstr2=replace(Ft_mbstr2,"$piccontent$",piccontent) 
'response.write Ft_mbstr2 
'图片库快速导航浏览 
firstrsd=server.CreateObject("adodb.recordset") 
sql="select top 1 pic_id,pic_name from Ft_pic order by pic_id" 
set firstrsd=conn.execute(sql) 
dim firstid 
firstid=firstrsd("pic_id") 
csname=firstrsd("pic_name") 
if instr(csname,"<font color")<>0 then 
 pictitle=split(csname,">") 
 pic_title=replace(pictitle(1),"</font","") 
else 
 pic_title=csname 
end if 
picnav= "<button&firstid&"'"" title="""&pic_title&""" class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>图库库首</button>&nbsp;" 
firstrsd.close 
set firstrsd=nothing 
backrsd=server.CreateObject("adodb.recordset") 
sql="select top 1 * from Ft_pic where pic_id<"&csid&" order by pic_id desc" 
set backrsd=conn.execute(sql) 
if backrsd.eof then 
 picnav=picnav+"<button disabled class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>第一张</button>&nbsp;" 
else 
 a0=backrsd("pic_id") 
 csname=backrsd("pic_name") 
 if instr(csname,"<font color")<>0 then 
  pictitle=split(csname,">") 
  pic_title=replace(pictitle(1),"</font","") 
 else 
  pic_title=csname 
 end if 
 picnav=picnav+"<button&a0&"'"" title="""&pic_title&""" class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>上一张</button>&nbsp;" 
end if 
backrsd.close 
set backrsd=nothing 
nextrsd=server.CreateObject("adodb.recordset") 
sql="select top 1 * from Ft_pic where pic_id>"&csid&" order by pic_id" 
set nextrsd=conn.execute(sql) 
if nextrsd.eof then 
 picnav=picnav+"<button disabled class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>最后一张</button>&nbsp;" 
else 
 a2=nextrsd("pic_id") 
 csname=nextrsd("pic_name") 
 if instr(csname,"<font color")<>0 then 
  pictitle=split(csname,">") 
  pic_title=replace(pictitle(1),"</font","") 
 else 
  pic_title=csname 
 end if 
 picnav=picnav+"<button&a2&"'"" title="""&pic_title&""" class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>下一张</button>&nbsp;" 
end if 
nextrsd.close 
set nextrsd=nothing 
lastrsd=server.CreateObject("adodb.recordset") 
sql="select top 1 pic_id,pic_name from Ft_pic order by pic_id desc" 
set lastrsd=conn.execute(sql) 
dim lastid 
lastid=lastrsd("pic_id") 
csname=lastrsd("pic_name") 
if instr(csname,"<font color")<>0 then 
 pictitle=split(csname,">") 
 pic_title=replace(pictitle(1),"</font","") 
else 
 pic_title=csname 
end if 
picnav=picnav+"<button&lastid&"'"" title="""&pic_title&""" class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>图库库尾</button>&nbsp;<button" title=""回壁纸浏览页面"" class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>回目录</button>&nbsp;<button" title=""关闭当前页面"" class=""put"" onmouseover=this.className='overput' onmouseout=this.className='put'>关闭</button>" 
lastrsd.close 
set lastrsd=nothing 
Ft_mbstr2=replace(Ft_mbstr2,"$picnav$",picnav) 

回复列表 (共2个回复)

沙发

这么长,都没有说在那里显示不出来,谁乐意看啊

板凳

newsfrom=rs("news_from")
Ft_mbstr2=replace(StrTemp(1),"$newsfrom$",newsfrom) 

这两句代码没问题咯
是不是库里面 news_form字段里没数据阿?

我来回复

您尚未登录,请登录后再回复。点此登录或注册