各位高手帮我改一点点代码吧!

shnep 2009-12-01 09:29:26
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/conn.asp" -->
<%
Dim rsbl
Dim rsbl_numRows

Set rsbl = Server.CreateObject("ADODB.Recordset")
rsbl.ActiveConnection = MM_conn_STRING
rsbl.Source = "SELECT * FROM productType WHERE subId like '1%' and subId <> '1_0'"
rsbl.CursorType = 0
rsbl.CursorLocation = 2
rsbl.LockType = 1
rsbl.Open()

rsbl_numRows = 0
%>
<%
Dim rshl
Dim rshl_numRows

Set rshl = Server.CreateObject("ADODB.Recordset")
rshl.ActiveConnection = MM_conn_STRING
rshl.Source = "SELECT * FROM productType WHERE subId like '2%' and subId <> '2_0'"
rshl.CursorType = 0
rshl.CursorLocation = 2
rshl.LockType = 1
rshl.Open()

rshl_numRows = 0
%>
<%
Dim rsproduct__MMColParam
rsproduct__MMColParam = "1"
If (Request.QueryString("id") <> "") Then
rsproduct__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim rsproduct
Dim rsproduct_numRows

Set rsproduct = Server.CreateObject("ADODB.Recordset")
rsproduct.ActiveConnection = MM_conn_STRING
rsproduct.Source = "SELECT * FROM productinfo WHERE productId like '" & rsproduct__MMColParam & "%' and productId <> '" & rsproduct__MMColParam & "_0'"
rsproduct.CursorType = 0
rsproduct.CursorLocation = 2
rsproduct.LockType = 1
rsproduct.Open()

rsproduct_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsproduct_numRows = rsproduct_numRows + Repeat1__numRows
%>

<%
Dim Repeat2__numRows
Dim Repeat2__index

Repeat2__numRows = -1
Repeat2__index = 0
rsproduct_numRows = rsproduct_numRows + Repeat2__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
Dim rs_website
Dim rs_website_numRows

Set rs_website = Server.CreateObject("ADODB.Recordset")
rs_website.ActiveConnection = MM_conn_STRING
rs_website.Source = "SELECT * FROM website"
rs_website.CursorType = 0
rs_website.CursorLocation = 2
rs_website.LockType = 1
rs_website.Open()

rs_website_numRows = 0
%>
<%
Dim rs_typeName__MMColParam
rs_typeName__MMColParam = "1"
If (Request.QueryString("id") <> "") Then
rs_typeName__MMColParam = Request.QueryString("id")
End If
%>
<%
Dim rs_typeName
Dim rs_typeName_numRows

Set rs_typeName = Server.CreateObject("ADODB.Recordset")
rs_typeName.ActiveConnection = MM_conn_STRING
rs_typeName.Source = "SELECT * FROM productType WHERE subId = '" + Replace(rs_typeName__MMColParam, "'", "''") + "'"
rs_typeName.CursorType = 0
rs_typeName.CursorLocation = 2
rs_typeName.LockType = 1
rs_typeName.Open()

rs_typeName_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="<%=(rs_website.Fields.Item("keyword").Value)%>">
<meta name="description" content="<%=(rs_website.Fields.Item("descr").Value)%>">
<title><%=(rs_website.Fields.Item("name_en").Value)%></title>

<link href="../css/dashengsoft.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
body {
background-color: #999999;
}
.STYLE7 {color: #FF0000}
div {
position:static;
width:155px;
height:92px;
z-index:1;
float:left;
text-align:center;
}
-->
</style>
</head>

<body>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td scope="col">

<table width="820" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td scope="col"> </td>
</tr>
</table>

<table width="820" height="133" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" scope="col"> </td>
</tr>
</table>
<table width="820" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="180" valign="top" bgcolor="#DDDDDD" scope="col"><table width="160" height="56" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="192" height="50" align="center" class="ft1" scope="col">CALSS APPLIANCES</td>
</tr>


<tr>
<td height="30" align="center" valign="bottom"><iframe src="newright.asp" frameborder="0" height="350" scrolling="no" width="180" ></iframe>

</td>
</tr>



</table>
<table width="160" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="192" height="50" align="center" class="ft1" scope="col">BABY APPLIANCES</td>
</tr>
<%
While ((Repeat2__numRows <> 0) AND (NOT rshl.EOF))
%>
<tr>
<td height="30" align="center" valign="bottom"><A HREF="product1.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "id=" & rshl.Fields.Item("subId").Value %>&tt=BABY APPLIANCES"><%=(rshl.Fields.Item("typeName_en").Value)%></A>
<hr size="1" noshade id="h1" style=" border-color:#CCCCCC; outline-style:solid; color:#FFFFFF; width:80%">
</td>
</tr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
rshl.MoveNext()
Wend
%>

</table>
<table width="160" height="158" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" scope="col"><a href="product_video.asp"></a></td>
</tr>
</table>
</td>
<td align="right" valign="top" scope="col"><table width="645" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" valign="top" scope="col"><table width="100%" height="35" border="0" cellpadding="0" cellspacing="0" bgcolor="#999999">
<tr>
<td height="35" scope="col">  <span class="ft7">PRODUCTS</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" scope="col"><table width="643" border="0" cellpadding="6" cellspacing="0">
<tr>
<td class="ft3" scope="col"><%=(rs_typeName.Fields.Item("typeName_en").Value)%></td>
</tr>
<% If Not rsproduct.EOF Or Not rsproduct.BOF Then %>
<tr>
<td ><%
dim counts
counts = 0
While ((Repeat1__numRows <> 0) AND (NOT rsproduct.EOF))
%>
<div><A HREF="productDetail.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "id=" & rsproduct.Fields.Item("id").Value %>" target="_parent"><img src="<%=(rsproduct.Fields.Item("smallimg").Value)%>" width="142" height="72" border="0"></A>
</div>


<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsproduct.MoveNext()
counts = counts + 1
if(counts = 4) then
response.Write("<br><br>")
counts = 0
end if
Wend
%> </td>
</tr>
<% Else %>
<tr>
<td scope="col"> <span class="STYLE7">Sorry, no such series of products temporarily</span></td>
</tr>
<% End If %>

</table></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="820" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" scope="col"> </td>
</tr>
</table>


</td>
</tr>
</table>

</body>
</html>
<%
rsbl.Close()
Set rsbl = Nothing
%>
<%
rshl.Close()
Set rshl = Nothing
%>
<%
rsproduct.Close()
Set rsproduct = Nothing
%>
<%
rs_website.Close()
Set rs_website = Nothing
%>
<%
rs_typeName.Close()
Set rs_typeName = Nothing
%>
...全文
103 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
shnep 2009-12-01
  • 打赏
  • 举报
回复
高手都不在线吗
shnep 2009-12-01
  • 打赏
  • 举报
回复
哇!还真快,我刚发完就有人回话了!果然,这里的人气很旺!
shnep 2009-12-01
  • 打赏
  • 举报
回复
<div><A HREF="productDetail.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "id=" & rsproduct.Fields.Item("id").Value %>" target="_parent"><img src="<%=(rsproduct.Fields.Item("smallimg").Value)%>" width="142" height="72" border="0"></A></div>在这里能不能按一定条件筛选出图片或数据.表中有两个字段ID与PRODUCID
lzp4881 2009-12-01
  • 打赏
  • 举报
回复
发这么长的代码,又不说问题,白白浪费了20分。

28,390

社区成员

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

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