|
我搞了个统计网站流量及其来源地址的,用在别的老的网页里和新建的网页都可以,但是用在下面的网页里面就不可以了,源代码如下:
2 ]) s1 w* s- ?4 {# ~/ N谁知道怎么回事请告诉我+ D2 T0 e" I2 r! I
5 _3 z" e7 Q5 I: y: s, Z* h
文件名: main.asp 代码如下:& F7 l5 C$ k! I3 N
9 L8 h. L9 X$ j9 s- c; I8 `8 h9 a8 y
<!--#include file="Head.asp"-->, O" n- V4 P6 H$ H9 e; k
<div id="Bodyer_index">& j- \) f1 i3 O5 n0 g, N" _+ X
<div id="Bodyer_banner_index"> ) ^5 {+ X$ h, Z& u
<script type="text/javascript">
. |4 W# }; t# P) [# Q3 f# F% K, s <!--
" e9 [4 S9 Z( N
. y# K# g' p, G; `( R7 C. o' @* P var focus_width=850
* Z1 B+ @) a! ?% a# D var focus_height=190, t; _/ h" S1 \ x/ L6 X' ^
var text_height=0( U% z3 _# M6 |% o5 A8 P
var swf_height = focus_height+text_height
. E. L! v- E# k E& y Q5 x
/ s n Y. w; b7 k
! Z8 L1 L% J z; M( _; s var pics='<%=pic%>'
/ R2 O0 C; E" J" H6 ], H var links='<%=link%>'+ v& \ e3 F+ A, U+ T6 C
var texts='<%=texts%>'
/ S p" `2 _# I document.write('<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
3 B+ b+ T' o7 v) U document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="../Include/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#000000">');( w, {, `5 W5 R
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');) d2 J# N1 o9 ?0 I7 s
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
; ~0 C) h2 d$ j; z, M e, _ document.write('<embed ID="focus_flash" src="../Include/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#000000" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
& D z; Y: M5 {7 [- I5 N% z document.write('</object>');- S6 p& M# d8 M
1 C9 H4 j" q( m/ j4 W2 G$ [ //-->5 v* D) L5 r. J) n% [0 q0 ~2 n
</script>
/ E* Y$ I) g* U% {% Q) T) i</div>
( x1 C- i% g/ ~+ f7 @ <div id="Bodyer_left_index">" ~- P. t6 c5 h& \% g
<div class="Bodyer_left_index_login"><%=Login()%></div>
% \$ |3 i2 D$ Z2 s# ] <div class="Bodyer_left_index_search"><%=Search()%></div>
6 u6 n/ Z. l0 V; I <div class="Bodyer_left_index_links"><%=FriendLink()%></div>9 j3 q2 n/ g) i+ G; f
<br/>
. ?/ S; E% |9 e, ?# B </div>: ^ E: }/ G4 m
<div id="Bodyer_right_index">7 ?0 c) ]3 y e; @2 u+ i* V! S! n) y
<div class="Bodyer_right_index_item"><img src="Images/Main_news.jpg" width="120" height="38" /></div>/ A* k z8 J& j' s! X e7 E
<div class="Bodyer_right_index_more"><a href="newslist.asp"><img src="Images/More.gif" width="29" height="5" border="0" /></a></div>
+ J, w) M6 W) f+ ]0 W <div class="Bodyer_right_index_list">
3 |# H, s% m8 N, w1 |1 a9 Q <div class="Bodyer_right_index_news"><%=News("0,")%></div>
- Z$ |5 g* ~5 g, @; s) [ </div>
% R3 X b! f- {- X <div class="Bodyer_right_index_item"><img src="Images/Main_product.jpg" width="120" height="38" /></div>) d! [+ R) \: ]% G) x: Z
<div class="Bodyer_right_index_more"><a href="productlist.asp"><img src="Images/More.gif" width="29" height="5" border="0" /></a></div>( S* J& W* x/ M$ X
<div class="Bodyer_right_index_list"><%=Products("0,",2,4)%><br/></div>
% Y; X( R6 p7 V% N </div>8 {8 k# L; T; T* l6 Q
</div>
/ ?4 b, t M% Y Y- F! f# T9 f) u4 O# z <p>; ?) |" R" s6 R
<%! X5 ?4 z+ f0 J4 u' l$ ]% D
function FriendLink()
0 w: o5 X# e9 [9 u! M. {% [* j dim rs,sql" d7 C2 V9 {; ^2 S
set rs = server.createobject("adodb.recordset"). ^7 p& }8 V* J- e( Z
sql="select top 4 * from liangjing_FriendLink where ViewFlag"&Language&" and LinkType order by id asc": }& q( U: F0 _# J$ g( Z
rs.open sql,conn,1,1
6 D' ^, w8 H6 B/ m, G9 P- f if rs.eof then
/ ~& G5 p+ q+ t: c, c4 ? response.write "暂无相关信息"1 U' S$ H/ ~ c2 p
else
% j/ \) R' {8 q$ K0 h do while not rs.eof7 s! X& {9 ~, S$ }! y8 n
response.write "<a href="""&rs("LinkUrl")&""" target=""_blank""><img src="""&rs("LinkFace"&Language)&""" alt="""&rs("LinkName"&Language)&"""></a><br/>"
# X& {+ J9 y+ e g! p0 G" | rs.movenext
% Y' ]- g' }. Q2 h" ^+ t2 D P loop , m7 {0 S/ M# A" I/ q- j
end if* _3 T1 D% h4 G
rs.close3 L5 n! {: {+ v$ ]6 }- |* z
set rs=nothing
& N* e5 F3 w' e1 L& b: Cend function+ X7 X; `, ?7 T& e- k
function News(SortPath)
7 x4 |3 B2 C# I7 p& s4 n% o dim rs,sql,NewsName,NewFlag
) a2 U6 j* w, L- Q4 S6 n set rs = server.createobject("adodb.recordset")! x" d' {, b+ a7 p' U8 o6 ~
sql="select top 7 * from liangjing_News where ViewFlag"&Language&" and Instr(SortPath,'"&SortPath&"')>0 order by id desc"
. B7 A H; d1 p E5 ]2 c9 [ rs.open sql,conn,1,1
+ h% T5 B: t$ {) C7 Y" {$ z7 t if rs.eof then M# m& ~6 i1 W
response.write "暂无相关信息"
7 i5 [- `! R7 R* w; w else# x/ w$ f4 F2 K
do while not rs.eof$ |/ K- w; k9 c' ]$ z
if now()-rs("AddTime")<=2 then
" f7 n- I) j7 G) V( C% I NewsName=StrLeft(rs("NewsName"&Language),32)$ ?( L( G8 n* P2 B$ q b" E
NewFlag=" <font style=""font-size:9px;color:red;""><strong>NEW</strong></font>"6 g) C# J2 v3 u# y
else: `+ a, K. T$ `) G% z8 t+ {
NewsName=StrLeft(rs("NewsName"&Language),36)8 C5 U# \) X/ V2 L1 N
NewFlag=""
! G s5 X4 [& ]! s% c. ] end if. g& u& j" s0 [ K" b1 B
response.write "<img src=""Images/Arrow_01.gif"" align=""absmiddle""> "&FormatDate(rs("Addtime"),15)&" | <a href=""NewsView.asp?ID="&rs("id")&""" title="""&rs("NewsName"&Language)&""">"&NewsName&"</a>"&NewFlag&"<br/>"
3 R$ C& Q" k' h! c8 J7 y rs.movenext
( Q2 F. z9 ^/ P loop
. c- B* U+ _$ L0 M7 k) v! M end if
u. z6 q' `. K1 ^6 I% t2 q rs.close a6 r! A5 O7 \* W# `, q
set rs=nothing; Z- x" o& A1 H g% m3 i: N3 |1 ]
end function% ]2 V4 A8 |( e9 B, u1 L0 }( Y! K
function Products(SortPath,trs,tds)- O! q6 u2 a' t! I- z% S; C
dim rs,sql,tr,td,ProductName,SmallPicPath
" P, W( t# h. p% E' R, Q: h set rs = server.createobject("adodb.recordset")1 r* Z& P$ N$ Q! P& A; {
sql="select top "&trs*tds&" * from liangjing_Products where ViewFlag"&Language&" and CommendFlag order by id desc"
" W# A; V) a) g$ ~ 'sql="select top "&trs*tds&" * from liangjing_Products where ViewFlag"&Language&" and CommendFlag and Instr(SortPath,'"&SortPath&"')>0 order by id desc"8 y( Q6 w5 V! x' h; T' S$ X6 j2 k% n
'sql="select top "&trs*tds&" * from liangjing_Products where ViewFlag"&Language&" and NewFlag order by id desc"
# J# q, c+ w- b, d" q rs.open sql,conn,1,1, d4 u1 W9 I1 U* a; N0 w+ H L
if rs.eof then
5 J9 V! ~+ W( _0 _" f- [ response.write "暂无相关信息"
7 d/ h$ N4 q" h3 Q% T8 c) Z' T- u else0 P+ j3 X ?" `% u
response.write "<table cellpadding=""0"" cellspacing=""0"">"
( d( q4 N! X; ? for tr=1 to trs
* x; ~* l+ z; g' i( v response.write "<tr>"$ O2 z4 p8 M3 P/ Z
for td=1 to tds '填充数据到表格
7 @: k/ n; p- _8 R% f4 F& \ if StrLen(rs("roductName"&Language))<=18 then @& p7 V' |/ t3 S$ f
ProductName=rs("roductName"&Language)
; T# U( l7 Z' \+ D5 X* {! R else
3 o) B! H: h" q6 Q" E3 Z/ B8 V1 b2 n ProductName=StrLeft(rs("roductName"&Language),16)
; t9 ~3 t/ }8 A2 v E/ K end if' J* r' f7 ]: X; `& V$ |
SmallPicPath=HtmlSmallPic(rs("GroupID"),rs("SmallPic"),rs("Exclusive"))
& q U6 w' L9 b" D response.write "<td>"' x* v3 l) B+ C" z* |2 l
response.write "<table cellpadding=""2"" cellspacing=""0"" >" &_/ X4 _* {; X, {) G, ]8 D4 I% Y
"<tr><td style=""border: 1px solid #ccc; width:120px; height:120px; text-align:center;"">" &_
6 G, T/ z% S" v, A3 ^ o& l "<a href=""ProductView.asp?ID="&rs("id")&""">" &_
7 ^& a! v/ S3 M, d& M2 G "<img src="""&SmallPicPath&"""javascriptrawImage(this,120,120);"" alt="""&rs("ProductName"&Language)&""" />" &_
- g% ]2 k7 T# p Q "</a>" &_
$ v/ x% e8 P, G" t "</td></tr>" &_
/ q9 q8 i% e7 s& e# m, D# K "<tr><td style=""height:24px; text-align:center;"">" &_ O$ I" A5 _! ]# h* C
"<a href=""ProductView.asp?ID="&rs("id")&""" title="""&rs("ProductName"&Language)&""">"&ProductName&"</a>" &_
% v# o/ k2 l5 N6 X7 c "</td></tr>" &_
+ l- U$ D$ P* v1 U) h! R# I "</table>"
( [: n3 P9 r2 z9 y$ J response.write"</td><td width=""14""></td>"
1 V7 E7 g6 }) V; E2 R9 M rs.movenext! x9 {$ V% Z6 T$ v8 o$ F" }
if rs.eof then exit for
+ b9 G8 ?0 g) q5 m! O% v next7 G/ M$ o% a: N9 V3 s! ?' d5 \
Response.Write "</tr>"
( w6 Z8 }$ y! T5 B8 U( q if rs.eof then exit for' O) Y& }- K( S* Y/ C* t V3 Q4 ?; a
next0 H, r: U( v1 p' u8 z, s' N7 ^
response.write "</table>"
1 i# K; a+ U: A# B& u+ @ end if& V1 O3 q, E' s% [
rs.close9 y) N( L3 o) U
set rs=nothing: ]3 b9 e0 F5 h7 M! h- W
end function1 [1 `( F# _1 g6 C, s; u9 L
%>
: H$ U/ \ Y' P. T6 m </p>
. [; {7 @' `" |) D! l <p>关键词: 护栏(栅栏),静电喷涂护栏(组装护栏),焊接护栏,网格护栏,道路护栏,公路护栏,阳台护栏,绿化护栏(防护栏,隔离栏),不锈钢护栏,楼梯,扶手 </p>( h! ?0 p7 B* r
<p>苏州护栏(张家港护栏,常熟护栏,太仓护栏,昆山护栏),无锡护栏(江阴护栏),南京护栏,常州护栏,南通护栏,淮安护栏,盐城护栏,扬州护栏,镇江护栏,宿迁护栏</p>
0 j. O: c* f' K
) w; |- [" c0 R& @& b <p><script language="javascript" src="http://count9.51yes.com/click.aspx?id=99838626&logo=1" charset="gb2312"></script> <script src="http://s135.cnzz.com/stat.php?id=1882721&web_id=1882721&show=pic" language="JavaScript" charset="gb2312"></script>
9 [( t6 _. l* X3 m+ Z</p>- c! R' b3 P2 K8 c; }( |
6 R M. f7 l2 b U: Y( |8 a) i
<!--#include file="Foot.asp"-->
3 g8 J- Q4 }/ N; `6 N4 o9 L<!--#include file="FocusLoad.asp" -->* L2 C" ?0 K0 c" _4 b7 o
- r! E* G5 l6 \+ g0 n
粗体是统计流量的代码 |
|