| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 343 人关注过本帖
标题:谁知道这段代码的作用.
只看楼主 加入收藏
故事人生
Rank: 2
等 级:论坛游民
帖 子:58
专家分:36
注 册:2010-3-30
结帖率:92.31%
收藏
已结贴  问题点数:20 回复次数:2 
谁知道这段代码的作用.
以下为代码片段,是一个添加产品的页面.这些代码在页面里就不能运行,不知是否缺少什么.
删除后就可以添加产品.但是不知有没有影响.
第一段代码,前头省略


<%
if Result="Modify" then
set rs = server.createobject("adodb.recordset")
sql="select * from LiangJingCMS_Products where ID="& ID
rs.open sql,conn,1,1
if rs.bof and rs.eof then
    response.write ("<center>数据库记录读取错误!</center>")
    response.end
end If
if rs("attribute1CH")<>"" and rs("attribute1CH_value")<>"" then
    attribute1CH_1=Split(rs("attribute1CH"),"§§§")
    attribute1CH_value_1=Split(rs("attribute1CH_value"),"§§§")
    Num_1=ubound(attribute1CH_1)+1
Else
    Num_1=0
End If
rs.close
set rs=Nothing
Else
    Num_1=0
End If
%>

第二段代码,中间省略


      Num_1=CheckStr(Request.Form("Num_1"),1)
      if Num_1="" then Num_1=0
      if Num_1>0 then
        For i=1 to Num_1
            If CheckStr(Request.Form("attributeCH"&i),0)<>"" and  CheckStr(Request.Form("attributeCH"&i&"_value"),0)<>"" Then
                If attribute1CH="" then
                    attribute1CH=CheckStr(Request.Form("attributeCH"&i),0)
                    attribute1CH_value=CheckStr(Request.Form("attributeCH"&i&"_value"),0)
                Else
                    attribute1CH=attribute1CH&"§§§"&CheckStr(Request.Form("attributeCH"&i),0)
                    attribute1CH_value=attribute1CH_value&"§§§"&CheckStr(Request.Form("attributeCH"&i&"_value"),0)
                End if
            End If
        Next

第三段代码,,中间省略
      rs("attribute1CH")=attribute1CH
      rs("attribute1CH_value")=attribute1CH_value
第四段代码,中间省略

      Num_1=CheckStr(Request.Form("Num_1"),1)
      if Num_1="" then Num_1=0
      if Num_1>0 then
        For i=1 to Num_1
            If CheckStr(Request.Form("attributeCH"&i),0)<>"" and  CheckStr(Request.Form("attributeCH"&i&"_value"),0)<>"" Then
                If attribute1CH="" then
                    attribute1CH=CheckStr(Request.Form("attributeCH"&i),0)
                    attribute1CH_value=CheckStr(Request.Form("attributeCH"&i&"_value"),0)
                Else
                    attribute1CH=attribute1CH&"§§§"&CheckStr(Request.Form("attributeCH"&i),0)
                    attribute1CH_value=attribute1CH_value&"§§§"&CheckStr(Request.Form("attributeCH"&i&"_value"),0)
                End if
            End If
        Next
      end if
第五段代码,中间省略
      rs("attribute1CH")=attribute1CH
      rs("attribute1CH_value")=attribute1CH_value

后面省略
搜索更多相关主题的帖子: 代码 
2010-04-02 20:35
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:20 
if Num_1>0 then
这个End IF在哪?
2010-04-03 12:53
sn01615
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-4-3
收藏
得分:0 
千博系统添加产品自定义属性的。
function num_1_1()
{
    var num_1=document.getElementById("Num_1").value;
    var num_1_str=document.getElementById("num_1_str");
    var str;
    str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
    str=str+"<tr><td height='28'>";
    str=str+"属性名称:<input name='attributeCh"+(parseInt(num_1)+1)+"' type='text' id='attributeCh"+(parseInt(num_1)+1)+"' size='18' /> 属性值:<input name='attributeCh"+(parseInt(num_1)+1)+"_value' type='text' id='attributeCh"+(parseInt(num_1)+1)+"_value' size='50' /></td>";
    str=str+"</tr>";
    str=str+"</table>";
    num_1_str.innerHTML=num_1_str.innerHTML+str;
    document.getElementById("Num_1").value=(parseInt(num_1)+1);
}
amdin.js里有这样一段吧,哈哈
2012-04-03 12:28
快速回复:谁知道这段代码的作用.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015214 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved