Display firefox referrals only to non-firefox users

Discussion in 'PHP' started by eXe, Sep 7, 2006.

  1. #1
    Hi, I'd like to display google adsense firefox referrals only to non-firefox users. Firefox users will see regular google text ads or something else. Help...
     
    eXe, Sep 7, 2006 IP
  2. wmburg

    wmburg Active Member

    Messages:
    300
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #2
    
    if(strpos($_SERVER["HTTP_USER_AGENT"],"Firefox"))
    {
      //firefox user
      //show adsense
    
    } else
    {
      //non-firefox user
      //show firefox referral
    
    }
    
    PHP:
     
    wmburg, Sep 7, 2006 IP
    northpointaiki likes this.
  3. Cryogenius

    Cryogenius Peon

    Messages:
    1,280
    Likes Received:
    118
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Here's an alternative solution which I use. My site will only display Picassa referals to Firefox users, and both to IE users. I also like to display 1 of many random referal buttons to mix colours, text and language (not shown):

    
    if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
      // show Firefox referral button
    } else {
      // show something else
    }
    
    PHP:
    Cryo.
     
    Cryogenius, Sep 8, 2006 IP
  4. fakhruddin

    fakhruddin Peon

    Messages:
    193
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4

    this is better coz it wont show the refferals in firefox the other one will only show in ie
    so other browsers like opera n all will show normal ads
     
    fakhruddin, Sep 8, 2006 IP
  5. eXe

    eXe Notable Member

    Messages:
    4,643
    Likes Received:
    248
    Best Answers:
    0
    Trophy Points:
    285
    #5
    Thanks :)
     
    eXe, Sep 8, 2006 IP