MyBB Community Forums

Full Version: Rotating HTML pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay so for a website I am helping to make, I want to rotate splash pages. For example, when user goes to the website, he'll be directed to one 4 random HTML pages.

Like, there will be the following pages:

index.html
index2.html
index3.html
index4.html
index5.html

And everytime the user goes to the website, a new splash page will randomly appear. How would I go about doing this? Any help would be much appreciated Smile
index.php that randomly calls an index.html in a folder. It would work similar to random image script.
(2010-03-06, 02:13 AM)NetSage Wrote: [ -> ]index.php that randomly calls an index.html in a folder. It would work similar to random image script.

Could you please explain more? I'm not good at php at all, so I don't even know what I would need to add to the index.php file.
<?php
include('index'.rand(1, 5).'.html');
?>
or something like that, you may need to make them .php pages and include an echo, I'm not sure.
Thanks guys. Went ahead and used what Tim provided.

http://humanjuicebox.com
Well seems to be working.
(2010-03-06, 02:35 AM)NetSage Wrote: [ -> ]Well seems to be working.

Yeah I'm not with the 3, 4, or 5th splash pages so once I get those done I'll add them to the rotation. Cool
Looks nice. Good job.