`Yousef Posted October 18, 2009 Share Posted October 18, 2009 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 Quote Link to comment Share on other sites More sharing options...
Kaboom Posted October 18, 2009 Share Posted October 18, 2009 Sorry.. i dont know what your asking to do.. explain exactly what you want, we cant read your mind. Quote Link to comment Share on other sites More sharing options...
`Yousef Posted October 18, 2009 Author Share Posted October 18, 2009 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. Quote Link to comment Share on other sites More sharing options...
Kaboom Posted October 18, 2009 Share Posted October 18, 2009 Oh so a random link page? Quote Link to comment Share on other sites More sharing options...
`Yousef Posted October 18, 2009 Author Share Posted October 18, 2009 Yes, but instead of actually being random so lets say in 4 goes it might pick site1 once, but site2 three times, itll share the redirects equally. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.