FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Whats the best way to..





calicamper
I'm wanting to make a folder of tips and tricks that will then be randomly selected about once a week (or day) and then displayed on my index as a hint of the day/week. Anyone have any good ideas? I thought of using InDesignto make a banner/image and have a random number generator select which to display, but I am not sure how to make it happen only every couple of days instead of everytime the site is loaded. Any ideas?
LukeakaDanish
If you (for example) use 52 banners for the weeks of the year, then you could use the php date module instead of a random number picker...

The following code outputs the weeknumber:

Code:
<?php echo date("W"); ?>
-]X[iNTaYkE]X[-
hmm, i think i have part of your answer...
first, you can place all of your banners into a MySQL Database with a link to the image and number each banner with an id number (when making the table, set the id column to use auto_increment, this will assign each row a unique id number). i'm not sure how to make it change daily, but to make it random, you can use srand and rand functions to select the banner randomly by randomly selecting a number between 0 and x, x being the id number with the highest value. heres an example of using the function:

Code:

<?php
srand ((double) microtime( )*1000000);
$random_number = rand(0,10);
echo "$random_number";
?>
Related topics
Whats best Online Multi Game??
whats best
whats best for a website thats mostly a forum?
Best of the free IDE's & why
Halo 2 - Best online game?
Your favourite group/singer? *OFFICIAL*
Google delares war on Microsoft!!!
WHATS BEST SOCCER GAME - PRO EVO 5 OR FIFA'06?????????
Dreamweaver or Golive?
Primus
[Help] Suggest a DVD ripper
Should I kill this person?
New to this.
Bluetooth Problem
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.