- <?php
( g" N# e w: R4 H8 F/ k% c4 t - 4 Y- a% G3 n+ U( \
- $flag = 'sos';//可改可不改
+ }9 F! k, U! l" X - $track = "amazon-20";//修改為自己的追蹤id- C$ S! k$ W/ a' Z* j6 I; [0 q
- $go = $_REQUEST['asin'];
! q2 Z6 Z1 ?1 V; m& p1 _
- H8 s# q* T1 B% y/ u9 h( l- if (!isset($_COOKIE[$flag])){7 V; _* g$ D9 G
- $url = "http://www.amazon.com/dp/$go?tag=$track";
8 u' O* G4 h4 B! N( H3 \ - setcookie($flag, "cnwebmasters", time()+3600*24);, j$ }8 R8 d% j' U; a( a
- }# J0 G( ?: M- J6 a3 }! S! L4 P
- else {: U; o+ L' |7 Q Z1 ^ t7 r, @
- $url = "http://www.amazon.com/dp/$go"; 8 v" e b' h4 m F/ T2 k& g
- }/ o& o/ G4 S+ F% b; y( O
: i) |8 a" P- _# K: B. y- header("HTTP/1.1 301 Moved Permanently");& H: S7 v# p. `2 G, n
- header ("Location: $url");
/ a1 R5 v. c% z3 z - ?>
複製代碼 將代碼保存為go.php,amazon鏈接改為domain/go.php?asin=amazon-asin+ O1 e# j6 C! O3 d; P5 K' @
4 w0 @$ M9 s5 @' r- I8 R6 R
這樣第一次跳轉使用追蹤id,24小時內再打開就不會出現追蹤id,但佣金照拿。amazon的cookies保存時間為24小時。! a4 C/ w N% W! r7 |7 d) ~
9 y5 D- L/ i# \, K. o* o }! Q
! L" r0 r% o" `7 l$ ^
|