If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Apr 2003
    Member #
    Can someone help me out with this one?

    I forgot how to make random things show on a PHP page, and I want to make a Random Advertisement so I can change advertisements everytime someone visits the page or clicks on a link.

    I need help with either: time-based(recommended, like the ad changes every 3 minutes or something ) or when they visit the page.

    Is there any PHP Coding for this type of thing (I see it in .shtml versions, but I want PHP. Shtml or any type of coding is preferred as well)?

    And like, the coding so that I can add different ads when needed.

    20 Turtle dollars for whoever can help me with this.


  3. #2
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Member #
    15 times
    You will HAVE to use JavaScript/Flash/VBscript if you want time based advertisments shown. PHP is server-side, so it can't do much after it has produced the HTML.

    There was a pretty good DreamWeaver extension to create a time based advertisment using javascript.

    a very simple PHP randomizer is below. It will show random advertisement every time the page is accessed:

    list.txt with all banners and links.
    PHP Code:
    $num rand(0sizeof($ads));

    $details explode("|"$ads[$num]);

    "<a href=\"".$details[1]."\" target=\"_blank\"><img src=\"".$details[0]."\"></a>";
    There and Back Again :Ogre:

  4. #3
    Junior Member
    Join Date
    Apr 2003
    Member #
    OHH!, I like, thanks. You get the dollars.

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 05:19 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: