Dynamic Banner Ads

Discussion in 'Software' started by rafaelo, Jun 14, 2005.

  1. rafaelo

    rafaelo Private E-2

    I am programming a website which is going to have banners ads on every page. Most of the time the ads will be changing dynamically from one page to the next. By this I mean that if I have 10 total ads and every page takes two ads. Then I need a system that will put two random ads in each page. The pages also need to have the ability to have static ads. If an advertiser always wants to be on a certain page then this needs o be possible.

    I have thought of two ways I can do this. I with a Database and 1 without.

    I am not looking for code here. Just ideas of how to I should implement this.

    Thank you in advance
     
  2. Corporal Punishment

    Corporal Punishment Administrator Staff Member

    If you dont want to count things you could use a simple php roation script:

    We sometimes run something like this
    ---------

    <?
    srand((double)microtime()*1000000);
    $randomnumber = rand(0,2); // change the second number to the number of includes

    $include0 = "ad1.txt";
    $include1 = "ad2.txt";
    $include2 = "ad3.txt";

    if ($randomnumber== "0") {
    include ("$include0");
    } else if ($randomnumber== "1") {
    include("$include1");
    } else if ($randomnumber== "2") {
    include("$include2");
    } else {
    $adcode = "ERROR: out of range, or not at all ";
    }
    ?>
    ---------

    However, you might want to look at this http://phpadsnew.com/two/ whcih is a full blow free PHP program. It's pretty awesome and would give you ideas if you really want to write your own.
     
  3. rafaelo

    rafaelo Private E-2

    Thank you for replying. but that does not solve the static ads that might be used on certain pages.

    I need a solution that will provide dynamic ads with the option of having static ads for certain pages.
     
  4. Corporal Punishment

    Corporal Punishment Administrator Staff Member

    phpadsnew will do static counts.
     
  5. rafaelo

    rafaelo Private E-2

    I will look into phpadsnew.
    Thank you
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds