Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: Advertisement Switching Script

  1. #1
    Join Date
    Jul 2006
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Advertisement Switching Script

    Alright, I need some help with this.
    I'm looking for a script that and switch between advertisements I have on my site. Now, this is the confusing part. Each ad has its own "script", so in order to make this work....ugh....I think this new script will have to render selected code at random. Hmm...

    Did I explain this right?
    Can anyone help?

    Twey, please? (lol)

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Hmm... what do you mean 'their own script'

  3. #3
    Join Date
    Jul 2006
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I mean like the google ads. They have their own script that you insert into the website and volia, the ad appears.

  4. #4
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    This could be done in javascript but would be much easier server side. Do you have access to PHP?

  5. #5
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    I would love to learn how to do this too!
    I have access to PHP.
    Thanks.

  6. #6
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    found the answer! check out:
    http://www.firethrottle.com/viewtut.php?id=42

  7. #7
    Join Date
    Jul 2006
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, see that's an image switcher. I need an advertisement switcher. Here's why I can't use this: I'm using Google Adsense. Google gives me a Javascript script to slip into my website for an advertisement to appear. This is the code for one:
    Code:
    <script type="text/javascript"><!--
    google_ad_client = "pub-5686021945884113";
    google_alternate_color = "191919";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text_image";
    google_ad_channel ="";
    google_color_border = "404040";
    google_color_bg = "191919";
    google_color_link = "2370B6";
    google_color_url = "2370B6";
    google_color_text = "FFFFFF";
    //--></script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    This could be done in javascript but would be much easier server side. Do you have access to PHP?
    Yes, I do.

  8. #8
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Ok, then this can be pretty easy.
    PHP Code:
    <?php
    $code_list
    [] = 'Some code';
    $code_list[] = 'Some other code';
    $code_list[] = 'Some more random code';
    shuffle($code_list);
    echo 
    $code_list[0];
    ?>
    Yes this will work javascript to

  9. #9
    Join Date
    Jul 2006
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Wow. Thanks man.
    So how does this work? Does it have to be a .php file or can I work in HTML?

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It has to be .php, and you have to have PHP enabled on your server.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •