Forum Moderators: coopster

Message Too Old, No Replies

weekly rotating content

         

leliphent

3:43 pm on May 5, 2005 (gmt 0)

10+ Year Member



looking for a simple php script that will rotate html or php pages weekly inside of an <iframe>?
any help?

dreamcatcher

5:10 pm on May 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

If you know a little PHP why not just assign the page names to an array and pull one random entry when the page loads.

dc

leliphent

6:48 pm on May 5, 2005 (gmt 0)

10+ Year Member



in theory that is what I had originally thought to do... but the problem I see is.... the content... I would need more content because it would change everytime it refreshes... I was looking basically to make it rotate with the date...

jatar_k

6:50 pm on May 5, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could show one page on even weeks and one on odd weeks, based on what week in the year it is

coho75

7:09 pm on May 5, 2005 (gmt 0)

10+ Year Member



Maybe something like this will work. This code has not been tested. It may need to be tweaked a little for your situation.

<?php

$dateUnit = date('l');

switch($dateUnit)
{
case "1" : $page = "page1.html";
break;

case "2" : $page = "page2.html";
break;

case "3" : $page = "page3.html";
break;

case "4" : $page = "page4.html";
break;

case "5" : $page = "page5.html";
break;

default : $page = "page0.html";
break;
}

?>

leliphent

8:27 pm on May 5, 2005 (gmt 0)

10+ Year Member



H,
you are the man... I will try it out!
thanx