Jump to content

List X banners in random order.


willdikuloz

Recommended Posts

No, you'll have to write it yourself and people here will probably help you when you run into a problem. Post whatever code you've already written, telling what's wrong with it. If you want some hints to get you started then you'll have to post some specific information, e.g. where are the filenames for these banners - in a database, in a text file, in an array, nowhere yet. How will 'x' be detemined? etc., etc.
[!--quoteo(post=374174:date=May 16 2006, 09:34 AM:name=willdikuloz)--][div class=\'quotetop\']QUOTE(willdikuloz @ May 16 2006, 09:34 AM) [snapback]374174[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Is there a script/snippet to show X amount of banners in random order?
[/quote]

I found this at [a href=\"http://www.hawkee.com\" target=\"_blank\"]http://www.hawkee.com[/a]:

[code]<?
$random_text = array("Random Text 1",
                    "Random Text 2",
                    "Random Text 3",
                    "Random Text 4",
                    "Random Text 5");
srand(time());
$sizeof = count($random_text);
$random = (rand()%$sizeof);
print("$random_text[$random]");
?>[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.