- <?php
! v) q' ]4 ~$ E4 Y) X- m3 u M, S
/ s4 k8 g5 \7 u9 g- $flag = 'sos';//可改可不改4 H7 p2 F: r# @
- $track = "amazon-20";//修改為自己的追蹤id
/ w% J/ `: \+ J! Z/ c - $go = $_REQUEST['asin'];
% a6 _4 c6 e/ p* O
, \1 G6 N+ R1 m5 j# r3 W2 Z5 P1 l- if (!isset($_COOKIE[$flag])){' D$ l, o$ D# i* [3 v- p) X7 k" R9 S
- $url = "http://www.amazon.com/dp/$go?tag=$track";0 p/ M6 k: y3 P. P$ k/ H' V
- setcookie($flag, "cnwebmasters", time()+3600*24);* S% }1 D/ U$ Y
- }
C! M, h) X5 @- J - else {
" a( \1 o6 t9 @* d - $url = "http://www.amazon.com/dp/$go"; " z8 ]' O" Q, x) j" |/ M7 F- R& v- e
- }# N h1 a- L5 H; J E) R+ b+ p$ y
- : [5 S6 c; l1 x
- header("HTTP/1.1 301 Moved Permanently");
2 R N3 D, X2 F4 Q( N) i - header ("Location: $url");
) V, y/ |$ A# k. o( G4 i - ?>
複製代碼 將代碼保存為go.php,amazon鏈接改為domain/go.php?asin=amazon-asin# C8 M% D& _4 N+ A# @
, M9 t6 G5 x8 l! `- z% K2 f2 ?, ^
這樣第一次跳轉使用追蹤id,24小時內再打開就不會出現追蹤id,但佣金照拿。amazon的cookies保存時間為24小時。
1 P# H( q* s6 h# [# b2 } B! p) L: n2 U$ G( l, V+ G: K
* H' d2 s* P! m# D, f' W |