回 帖 发 新 帖 刷新版面

主题:!!!小女子肯求大家帮忙

本程序在执行时,一直出现:参数catid必须为数字型,请正确操作!,我认为问题出现在这一句:<form method=Post action=<% = filename %>?catid=<% = catid %>>
但不知道catid表示什么意思?

<META http-equiv=Content-Type content="text/html; charset=gb2312">
            <style type="text/css">
<!--
.style1 {color: #999999}
.unnamed1 {text-decoration: none;
}
-->
            </style>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><%
                Const MaxPerPage=30
                   dim totalPut   
                   dim CurrentPage
                   dim TotalPages
                   dim j
                   dim sql
                    if Not isempty(SafeRequest("page",1)) then
                      currentPage=Cint(SafeRequest("page",1))
                   else
                      currentPage=1
                   end if 
         set rs=server.CreateObject("adodb.recordset")
           rs.open "select top 50 id,name,pic,price1,price2,adddate,stock,spic from product where stock >= 0 and recommend<>3 order by adddate desc",conn,1,1
                  if rs.eof And rs.bof then
                       Response.Write "<p align='center' class='contents'> 对不起,此分类暂时还没有商品!</p>"
                   else
                      totalPut=rs.recordcount

                      if currentpage<1 then
                          currentpage=1
                      end if

                      if (currentpage-1)*MaxPerPage>totalput then
                           if (totalPut mod MaxPerPage)=0 then
                             currentpage= totalPut \ MaxPerPage
                           else
                              currentpage= totalPut \ MaxPerPage + 1
                           end if
                      end if

                       if currentPage=1 then
                        showContent
                        
                       else
                          if (currentPage-1)*MaxPerPage<totalPut then
                            rs.move  (currentPage-1)*MaxPerPage
                            dim bookmark
                            bookmark=rs.bookmark
                            showContent
                             
                        else
                            currentPage=1
                               showContent
                               
                          end if
                       end if
                                      end if

                   sub showContent
                   dim i,t
                   i=0
                t=1

            %>
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <%
            do while not rs.eof
            %>
                      <tr>
                        <%
                  for t=1 to 5
                      if not rs.eof then
                  %>
                        <td align="center" bgcolor="#f7f7f7"><TABLE WIDTH="140" HEIGHT="140" BORDER="0" CELLPADDING="0" CELLSPACING="0">
                            <TR>
                              <TD height="140" width="140" colspan="2" align="center" background="image/cplistbg.jpg"><div align="center"><a href=b2b_cpinfo.asp?id=<% = rs("id") %> target="_blank">
                                <% if trim(rs("spic"))<>"" then %>
                                <img src=image\<% = trim(rs("spic"))%>  border=0 width="120" height="120"></a>
                                <%  else %>
                                <img src=images/emptybook.jpg  border=0 width="120" height="120">
                                <% end if %>                              
                              </div></TD>
                            </TR>
                            <tr>
                              <td align="center"><%=trim(rs("name"))%></td>
                            </tr>
                            <tr>
                              <td align="center"><table width="100%"  border="0" cellspacing="1" cellpadding="1">
                                <tr>
                                  <td width="93%" align="center">市场价:<%=trim(rs("price1"))%>元</td>
                                  <td width="7%" align="center"><a href="b2b_cpinfo.asp?id=<%=rs("id")%>" target="_blank"><img src="image/but_bbogi.gif" width="14" height="16" border="0" align="absmiddle" /></a></td>
                                </tr>
                                <tr>
                                  <td align="center"><b>会员价:<font color="#FF0000"><%=trim(rs("price2"))%>元</font></b></td>
                                  <td align="center"><a href="####" onClick="MM_openBrWindow('check.asp?ProdId=<%=rs("id")%>','','scrollbars=yes,width=760,height=500')"><img src="image/but_bbogi2.gif" alt="购物车" width="14" height="14" border="0"></a></td>
                                </tr>
                              </table></td>
                            </tr>
                        </TABLE></td>
                        <%
                        else
                    %>
                        <%
                        end if
                        if t<>5 then
                            rs.movenext
                        end if
                    next
                    %>
                      </tr>
                      <%
            i=i+5
            if i>=MaxPerPage then Exit Do
            rs.movenext
            loop
            rs.close
            set rs=nothing
            end sub
                Function showpage(totalnumber,maxperpage,filename)  
                  Dim n
                  
                If totalnumber Mod maxperpage=0 Then  
                    n= totalnumber \ maxperpage  
                Else
                End If %>
                  <form method=Post action=<% = filename %>?catid=<% = catid %>>
                    <%
                If CurrentPage<2 Then  %>
                    <div align="center">
                    
                    首页 上页
                    <% Else  %>
                    <div align="center">
                    
                    <a href=<% = filename %>?page=1&catid=<% = catid %>>首页</a> <a href=<% = filename %>?page=<% = CurrentPage-1 %>&catid=<% = catid %>>上页</a>
                    <%
                End If
                If n-currentpage<1 Then  %>
                    下页 尾页
                    <%    Else  %>
                    <a href=<% = filename %>?page=<% = (CurrentPage+1) %>&catid=<% = catid %>>下页</a> <a href=<% = filename %>?page=<% = n %>&catid=<% = catid %>>尾页</a>
                    <%    End If  %>
                    第 <b>
                      <% = CurrentPage %>
                      </b>页 共 <b>
                        <% = n %>
                        </b>页 共 <b>
                          <% = totalnumber %>
                          </b>件商品 每页 <b>
                            <% = maxperpage %>
                            </b> 件商品 转到第:
                    <input class='input_sr' type='text' name='page' size=2 maxlength=10 value=<% = currentpage %>>
                    页
                    <input type='submit' class='input_bot' value='跳转' name='cndok'>
                  </form>
                  <%
                End Function  
            %>
                  </table></td>
              </tr>
              <tr>
                <td><%showpage totalput,MaxPerPage,"b2b_cplist.asp"%></td>
              </tr>
            </table>


回复列表 (共1个回复)

沙发

已经回复

我来回复

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