How to send traffic to a certain page first time and if they hit back button to other

Discussion in 'PHP' started by jesse431, Oct 4, 2009.

  1. #1
    Hi everyone,

    I am wondering if there is a way to implement something into this code that; (1) if the referer is set properly from google.com, it will always send the initial traffic to http://mysiteA.com; (2) but when the back button is pressed it will send them to the other links besides http://mysiteA.com.

    <?php
    $ref = $_SERVER["HTTP_REFERER"];
    if (strpos($ref,'google.com')!==FALSE) {
    $urls = array
    ("http://mysiteA.com",
    "http://mysiteB.com",
    "http://mysiteC.com",
    "http://mysiteD.com",
    "http://mysiteE.com");
    
    $url = $urls[array_rand($urls)];
    
    header("Location: $url");
    }
    ?> 
    Code (markup):

     
    jesse431, Oct 4, 2009 IP
  2. goliath

    goliath Active Member

    Messages:
    308
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #2
    So, why would you want to do that?
     
    goliath, Oct 4, 2009 IP