Jump to content

[HELP] Creating a redirect that directs to several pages in equal share


`Yousef

Recommended Posts

Hey there fellas,

 

I need some help creating a PHP redirect script that will redirect to a possibilty of several different pages in equal share, not randomized like many other redirect scripts. Would it be possible to do this using just PHP or would it require something else like MySQL to log the amount of redirects to each page.

 

If anyone could get me started with what functions to look into, or a snippet of code it'd be greatly appreciated.

 

Thanks alot ;)

Well, I have a main page with a link. This will link to a PHP redirect page which will have code like this on it

<?php
$urls = array("www.site1.com",
              "www.site2.com",
              "www.site3.com");
$url = $urls[array_rand($urls)];
header("Location: http://$url");
?> 

 

I want each one of the sites to be displayed in equal share, so for example, site1 gets displayed once, then site2 then site3 and then start looping on and on.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.