Need a script to store/read Adsense ID's (for rev. sharing)

Discussion in 'HTML & Website Design' started by Quintox, Oct 23, 2007.

  1. #1
    I suck at programming. I need a script where I can save Adsense ID's, and then have them randomly (or in order) be 'inserted' into the proper place in the Adsense code in my .php file. Everytime a page is loaded so that it shows a different ad each time.

    I know this must be simple, but can someone whip it up real fast for me?
     
    Quintox, Oct 23, 2007 IP
  2. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #2
    I could be wrong but I think Google handles which ads are displayed when. publisher can say text only or identify specific advertisers for a slot?

    do you mean like the way this forum works?

    Q...
     
    QiSoftware, Oct 23, 2007 IP
  3. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #3
    
    $adsense_ids = array( 'id1', 'id2', 'id3' );
    
    $adsense_id = $adsense_ids[ rand(0, count( $adsense_ids) - 1 ) ];
    
    echo "<!-- Adsense code with $adsense_id -->";
    
    Code (php):
     
    Synchronium, Oct 23, 2007 IP
  4. Quintox

    Quintox Peon

    Messages:
    239
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I will test that out, thank you very much
     
    Quintox, Oct 23, 2007 IP