![]() |
Rotating pages for display on the same url?
Say I have my traffic going to http://www.domain.com for which I have 4 entirely different HTML pages. I want these pages to rotate through 1 by 1 throughout the day. So each consecutive page view is displayed the next HTML file in the list, cycling through different pages for the viewers throughout the day. Evenly distributing the pageviews amongst the designs.
How would one go about achieving something like this? Is there an easy php fix for redirection that handles this function? Is it something doable with .htaccess? |
<SCRIPT LANGUAGE="JavaScript">
var howMany = 4; var page = new Array(howMany+1); page[0]="URL"; page[1]="URL"; page[2]="URL"; page[3]="URL"; page[4]="URL"; function rndnumber(){ var randscript = -1; while (randscript < 0 || randscript > howMany || isNaN(randscript)){ randscript = parseInt(Math.random()*(howMany+1)); } return randscript; } quo = rndnumber(); quox = page[quo]; window.location=(quox); </SCRIPT> make a .html or .php that is this and put the urls to load in that. if you want the location to be seemless, use a superframe ( 0,0,* ) type |
PHP Version:
Code:
<?php 1.html 2.html etc You just need that code in index.php and it will redirect. |
ya not hard
|
Quote:
|
|
Quote:
You could also do it with a Server Side Include. |
All times are GMT -7. The time now is 06:45 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123