- <?php
, Q5 S+ O0 B% H: s' W
4 ~$ z B; t% A4 z% _5 b- $flag = 'sos';//可改可不改% |- |% q* h! h
- $track = "amazon-20";//修改為自己的追蹤id: x! o" i" B% X, t8 [' f
- $go = $_REQUEST['asin'];. c; G* l, |- ]3 }' V Z
4 p T' L5 U0 L8 x- if (!isset($_COOKIE[$flag])){
1 V3 ^ E4 I( N* M+ G+ t - $url = "http://www.amazon.com/dp/$go?tag=$track";! ^* i$ x7 @ f# z( C2 p: W
- setcookie($flag, "cnwebmasters", time()+3600*24);
; K3 O" [( J c- x+ z$ d - } \6 ~" T1 o) Y a" V6 X" d
- else {0 D) s" u' S9 D' ]5 e
- $url = "http://www.amazon.com/dp/$go";
* L6 a& k9 \/ `! R2 A) T6 C/ b# k" ~ - }6 |( J* o$ C) _' r9 a
! y! V5 O$ z C0 E# ]) \/ ^- header("HTTP/1.1 301 Moved Permanently");
% i2 f g3 ^9 v7 I' r - header ("Location: $url");( O. C. W8 P7 v- E1 ~3 T7 O- K
- ?>
複製代碼 將代碼保存為go.php,amazon鏈接改為domain/go.php?asin=amazon-asin% n# S* ?2 v2 W
" V" N) {6 E% ~/ {) _+ w
這樣第一次跳轉使用追蹤id,24小時內再打開就不會出現追蹤id,但佣金照拿。amazon的cookies保存時間為24小時。3 W& s7 m4 `) g9 {3 ~3 p; J. d
/ c$ ~+ j; p/ `& [3 j* f
5 ]* i6 J- T% V8 K |