1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

redirect user to different landingpages

Discussion in 'PHP & Perl' started by cocaco, Mar 5, 2011.

  1. cocaco

    cocaco Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 6, 2009
    Messages:
    316
    Likes Received:
    443
    Hello,

    i need a script which redirects every second user to another page. (so we can split the traffic to 2 landingpages)

    in peudo code it would look like this:


    i=1
    i++
    if (i%2=0)
    redirect user to "http://xxxx"
    else
    redirect user to "http://yyyy"


    thanks in advance,

    i have no idea about php, only general understanding of programming.

    thanks a lot for the guy helping me!"
     
  2. peetu69

    peetu69 Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 7, 2010
    Messages:
    194
    Likes Received:
    131
    Location:
    420
    sent him similar script that did the job
     
    • Thanks Thanks x 1
  3. Evan Foster

    Evan Foster Junior Member

    Joined:
    Mar 1, 2011
    Messages:
    168
    Likes Received:
    59
    Occupation:
    Remote Student
    Should I use a landing page or a redirect? for new affiliates
     
    • Thanks Thanks x 1
  4. chrum

    chrum Newbie

    Joined:
    Mar 1, 2011
    Messages:
    14
    Likes Received:
    2
    Code:
    if (date("s")%2==0) {
    [COLOR=#000000][COLOR=#0000BB]header[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'Location: firstlandingurl'[/COLOR][COLOR=#007700]);[/COLOR][/COLOR]
    } else {
    [COLOR=#000000][COLOR=#0000BB]header[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'Location: secondlandingurl'[/COLOR][COLOR=#007700]);[/COLOR][/COLOR]
    }
     
    Last edited: Mar 7, 2011