Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ptown

macrumors newbie
Original poster
Jan 14, 2004
21
0
Here's a tricky one for ya.

I am putting together a collaborative site that will feature 4 different designers. Each designer has designed an individual splash page which consists of one image centered on the page, with a designated background color. Each page has a different image and background color. I am trying to figure out how I can have it so that when you go to the designated url, one of the 4 pages will randomly be the index page, then when the user refreshes it will randomly rotate an load another one of the four pages.

Any suggestions.
 

brianellisrules

macrumors regular
Oct 17, 2003
229
0
write it in php.... make index.php just have an include line and randomize which file is selected....
PHP:
<?
$num=rand(1,4);
include ("/homepage$num.".php"");
?>
homepage1.php through homepage4.php would be the page for each of your designers and it'll get randomly selected when the page loads.

(Note: I'm new to php, so I'm not sure if the above code will work without some trial-and-error to make sure the syntax is correct.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.