Guest User

Untitled

a guest
Jan 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. $pages = array(
  4. "buy1.html",
  5. "buy2.html"
  6. );
  7.  
  8. if (!isset($_COOKIE['bpm_buy'])){
  9. $n = count($pages);
  10. $go = rand(1,$n);
  11. setcookie("bpm_buy", $go, time()+60*60*24*7);
  12. }else{
  13. $go = $_COOKIE['bpm_buy'];
  14. }
  15.  
  16. header('Location: '. $pages[$go-1]);
  17.  
  18. ?>
  19.  
  20. /////////////// I NEED TO PASS QUERY STRING TO THE REDIRECT. THIS IS
  21. //////////////// NOT WORKING: header('Location: '. $pages[$go-1]) . $_SERVER['QUERY_STRING']);
Add Comment
Please, Sign In to add comment