please help i want this code..

Discussion in 'Google' started by Mr.only, Dec 21, 2010.

  1. #1
    i searching for Php code to make Rotation of ads between the two accounts in Adsense

    something give 50% or 60% to one of these accounts ..


    so .. can any one help me ..
     
    Mr.only, Dec 21, 2010 IP
  2. Mr.only

    Mr.only Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    can any one help me . please
     
    Mr.only, Dec 22, 2010 IP
  3. Joe Hansens

    Joe Hansens Guest

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    php has a built in random function

    step 1 - on every page load use php to generate a random number between 1 and 100

    then use an if then statement to specify when one ad group is shown (example show ad space 1 when var1 < 51 etc.,,)

    does that help?
     
    Joe Hansens, Dec 30, 2010 IP
  4. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #4
    simple:
    if (rand(1,2)==1) {
    echo "ad code 1" ;
    } else {
    echo "ad code 2";
    }
    it's the easiest for 50/50
     
    JamesColin, Jan 1, 2011 IP
  5. Mr.only

    Mr.only Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanxxxx

    how can i give 70/30
     
    Mr.only, Jan 4, 2011 IP
  6. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #6
    if (rand(1,10)<=7) {
    echo "ad code 1" ;
    } else {
    echo "ad code 2";
    }
    code 1 will display 7 times out of 10, code 2 3 times out of 10
     
    JamesColin, Jan 4, 2011 IP