?? productview.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="include/const.asp"-->
<!--#include file="include/CODE.asp"-->
<%
dim sql
dim rs
dim rstype
dim typesql
dim typeid,typename,classname,classid,Nclassname,Nclassid
dim title
set rs=server.createobject("adodb.recordset")
sql="update product set hits=hits+1 where productID="&request("id")
rs.open sql,conn,1,3
sql="select Aclass.class,ANclass.Nclass,product.title,product.classid,product.Nclassid from product,Aclass,ANclass where product.classid=Aclass.classid and product.Nclassid=ANclass.Nclassid and product.productID="&request("id")
rs.open sql,conn,1,1
if not rs.eof then
title=rs("title")
classid=rs("classid")
Nclassid=rs("Nclassid")
classname=rs("class")
Nclassname=rs("Nclass")
end if
rs.close
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="ASP動網(wǎng)先鋒,http://www.aspsky.net">
<LINK href="include/STYLE.CSS" rel=stylesheet>
<title><%=title%></title>
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width="750" border=0 align=center>
<TBODY>
<TR>
<TD> <table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="760"><!--#include file="head.inc" --></td>
</tr>
<tr>
<td height="32" background="images/bg_2.gif"> <%
sql="select class,classid from Aclass"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "還沒有任何欄目"
response.end
else
do while not rs.eof
%>
| <a href="default.asp?classid=<%=rs("classid")%>">
<%if cint(rs("classid"))=cint(classid) then%>
<font color=red><%=rs("class")%></font>
<%else%>
<%=rs("class")%>
<%end if%>
</a> | <%
rs.movenext
loop
end if
rs.close
dim key
sql="select * from product where productid="&request("id")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "沒有找到相關(guān)產(chǎn)品。"
response.end
end if
if rs("Nkey")<>"" then
key=rs("Nkey")
else
key="None News"
end if
%> </td>
</tr>
<tr>
<td height="10" valign="top"></td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="1" cellspacing="2">
<tr>
<td><table width=100% border=0 cellpadding=0 cellspacing=0 background="images/bg_1.gif">
<tr>
<td height="28"> 您當前的位置:網(wǎng)站首頁>><a href="productclass.asp?classid=<%=classid%>"><%=classname%></a>>><a href="productclass.asp?classid=<%=classid%>&Nclassid=<%=Nclassid%>"><%=Nclassname%></a></td>
<td width=50><img src=pic/printpage.gif align=absmiddle>
<a href=printpage.asp?id=<%=request("id")%> >打印</a></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="2" cellpadding="1">
<tr>
<td><div align="center"><font class="b1">
<% if rs("images")="" then %>
<img src="images/nopic.gif" border="0">
<%else%>
<img src="<%=rs("images")%>" border="0">
<%end if%>
</font></div></td>
<td width="300"><p><b>產(chǎn)品名稱:</b><%=rs("title")%><br>
<strong>產(chǎn)品價格:</strong>
<%if not isnull(rs("price")) then%>
<%=rs("price")%>
<%else%>
不詳
<%end if%>
<br>
<strong>產(chǎn)品狀態(tài):</strong>
<%if not isnull(rs("state")) then%>
<%=rs("state")%>
<%else%>
不詳
<%end if%>
<br>
<strong>查看次數(shù):</strong><%=rs("hits")%><br>
<strong>發(fā)布日期:</strong> <%=rs("dateandtime")%></p>
<p align="right"> 【<a href=sendmail.asp?id=<%=rs("productid")%>>告訴好友</a>】
</p></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28" background="images/bg_1.gif">產(chǎn)品詳細描述:</td>
</tr>
<tr>
<td><%=rs("content")%></td>
</tr>
<tr>
<td height="28" background="images/bg_1.gif">其它</td>
</tr>
<tr>
<td> <%
rs.close
sql="select title,productid from product where productid="&request("id")-1
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%> <p>
<li>上條產(chǎn)品:已經(jīng)沒有了
<%else%>
<p>
<li>上條產(chǎn)品:<a href="productview.asp?id=<%=rs("productid")%>"><%=rs("title")%></a>
<%end if%>
<BR>
<% rs.close
sql="select title,productid from product where productid="&request("id")+1
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<li>下條產(chǎn)品:已經(jīng)沒有了
<%else
%>
<li>下條產(chǎn)品:<a href="productview.asp?id=<%=rs("productid")%>"><%=rs("title")%></a>
<%end if%>
</td>
</tr>
</table></td>
<td width="165" valign="top" bgcolor="#EFFBCE"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" background="images/bg_2.gif">□- 本周熱門產(chǎn)品
</td>
</tr>
<tr>
<td> <%
dim i
set rs=conn.execute("SELECT top 7 productid,title,hits FROM product where month(dateandtime)=month(date()) and day(dateandtime)>=day(date()-6) order by hits desc")
i=1
do while not rs.eof
%> <%=i%>.<a href="productview.asp?id=<%=rs("productid")%>" title="<%=rs("title")%>" target=_top>
<%if len(rs("title"))>18 then%>
<%=left(rs("title"),18)%>...
<%else%>
<%=rs("title")%>
<%end if%>
</a>[<font color=red><%=rs("hits")%></font>]<br> <%
i=i+1
rs.movenext
loop
%> </td>
</tr>
<tr>
<td height="28" background="images/bg_2.gif">□- 相關(guān)產(chǎn)品</td>
</tr>
<tr>
<td> <%
set rs=conn.execute("SELECT top 7 productid,title FROM product where Nkey='"&key&"' order by productid desc")
do while not rs.eof
%><li><a href='productview.asp?id=<%=rs("productid")%>'><%=rs("title")%></a><br>
<%
rs.movenext
loop
%>
</ul></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
<tr>
<td><!--#include file="foot.inc" --> </td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -