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 ;)

Link to comment
Share on other sites

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.

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.