mumford
-
Posts
6 -
Joined
-
Last visited
Never
Posts posted by mumford
-
-
Andy B, that looks like it will be the best response I have received over 2 days, thank you!
I suppose if I need to have other items that rotate on a daily basis I just inser the same code but change the filenames eg
[code]<?php
$doty = date("z"); // day of the year
$doty_remainder = $doty % 5 ; // remainder of day of the year divided by 5
$the_file = "[b]dynamic/offers[/b]_". $doty_remainder. ".php"; // edit path info to suit
include($the_file);
?>[/code]
Also as a matter of interest if I did want those 5 pages to rotate randomly is there a way of adjusting the code you gave or would it be something different entirely?
Thanks again -
sounds exactly what i need, but I dont even know where to start to get that working, your help or guidance would be much appreciated.
thanks -
Can anyone else shed some more light on how I go about setting this up to switch content on a daily basis, do I really have to set up a database?....... there will only be about 5 alternative text blocks
-
Thanks fo rthe quick replies, like I sadi I know very lttle PHP (at the moment!)
So I would have to create a database where all of my text divs would sit, then call them from the homepage? -
Hi
I am VERY new tp php, and found this script on php freaks, it is a randomizer script
[code]<?
/* Directory Structure
/index1.htm
/index2.htm
*/
srand((double)microtime()*1000000);
$num = rand(1,2);
include ('index'.$num.'.htm');
?>[/code]
What I need to happen on my website is 3 blocks of text each in its own div to change every day (5 days to be precise), I got the above to work but as I said it is just a randomizer so each time you refresh it changes.
Also my dynamic content pages will sit in its own folder, and I would like to name the pages depending on what they are, eg, capetown.htm, garden-route.htm
Does that make sense, hope someone can help me!
thanks
Rotate Dynamic Content Every Day
in PHP Coding Help
Posted