Jump to content

RANDOM INDEX PAGE


cosmickites

Recommended Posts

I have spent 3 months trying to get an answer to this.  We are looking to randominze either our index page or simply the body of the index page. I want the product review to be random when people come visit our page.

www.cosmickites.com

 

is this possible?  could anyone please please help?

 

Thank you

 

Michael

Link to comment
Share on other sites

whoa, too many images and stuff for me to wait for it to load...

But here's a snippit of a 'rough' I did for someone a while back, it might be a little too much but it is fairly accurate:


session_start();


$l=array(0,1,2,3,4,5,0,1,2,3,0,1,0,1,0,1,0,1,0,0);
if(isset($_SESSION['redirector']))
{
$l = $_SESSION['redirector'];
}
if(count($l) == 0)
{
$l=array(0,1,2,3,4,5,0,1,2,3,0,1,0,1,0,1,0,1,0,0);
}

function get_redirect()
{
global $l;

$url[0] = "http://www.siteone.com";
$url[1] = "http://www.sitetwo.com";
$url[2] = "http://www.sitethree.com";
$url[3] = "http://www.sitefour.net";
$url[4] = "http://www.sitefive.com";
$url[5] = "http://www.sitesix.com";

srand ((double)microtime()*1000000);
$n = rand(0, count($l)-1);
$ll = array_keys($l);
$nn = $ll[$n];
$sret = $url[$l[$nn]];
unset($l[$nn]);
$_SESSION['redirector'] = $l;

return $sret;
}

print get_redirect();

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.