`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 Link to comment https://forums.phpfreaks.com/topic/178099-help-creating-a-redirect-that-directs-to-several-pages-in-equal-share/ 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. Link to comment https://forums.phpfreaks.com/topic/178099-help-creating-a-redirect-that-directs-to-several-pages-in-equal-share/#findComment-939066 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. Link to comment https://forums.phpfreaks.com/topic/178099-help-creating-a-redirect-that-directs-to-several-pages-in-equal-share/#findComment-939073 Share on other sites More sharing options...
Kaboom Posted October 18, 2009 Share Posted October 18, 2009 Oh so a random link page? Link to comment https://forums.phpfreaks.com/topic/178099-help-creating-a-redirect-that-directs-to-several-pages-in-equal-share/#findComment-939075 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. Link to comment https://forums.phpfreaks.com/topic/178099-help-creating-a-redirect-that-directs-to-several-pages-in-equal-share/#findComment-939077 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.