GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Rotating pages for display on the same url? (https://gfy.com/showthread.php?t=940013)

Angry Jew Cat - Banned for Life 11-23-2009 08:09 PM

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?

Thurbs 11-23-2009 08:20 PM

<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

XD2 11-23-2009 08:26 PM

PHP Version:
Code:

<?php
header("Location: /".rand(1,4).".html"); exit();
?>

Just make the same amount of html pages as you specify in the rand(1,4) part for example:
1.html
2.html
etc

You just need that code in index.php and it will redirect.

fris 11-23-2009 08:32 PM

ya not hard

Angry Jew Cat - Banned for Life 11-23-2009 08:38 PM

Quote:

Originally Posted by fris (Post 16579120)
ya not hard

no speako no phpo senior...

Doctor Feelgood 11-23-2009 09:05 PM

http://www.focalmedia.net/htmlrotate.html

Les Grossman 11-24-2009 03:49 AM

Quote:

Originally Posted by Doctor Feelgood (Post 16579196)

I use that, very handy.

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