luke777 Posted December 29, 2007 Share Posted December 29, 2007 Hi At the moment this script works perfect, sends out the number of hits to each site that i want it to.... it stores data in a file named stats.omg What I need is... for it to be changed so that hits are not sent out in bulk, i need to spread the traffic out over the the whole day instead of the sites recieving a bulk of traffic at 1 point in the day. Mabe one way of doing this would be making the script random. Games.php contains: <?php $urls="http://www.externalsite1.com||200,http://www.externalsite2.com||300,http://www.externalsite3.com||170"; $urls=explode(",",$urls); $i=0; foreach($urls as $url){ $url=explode('||',$url); $sites[$i]['url']=$url[0]; $sites[$i]['hits']=$url[1]; $i++; } $omg=file_get_contents('stats.omg'); $handle=fopen('stats.omg','w+'); if(!$omg){ foreach($sites as $site){ $stats[]=0; } } else{ $stats=unserialize($omg); } for($i=0;$i<=count($sites)-1;$i++){ if($stats[$i]<$sites[$i]['hits']){ $stats[$i]++; $stats=serialize($stats); fwrite($handle,$stats,strlen($stats)); header("Location: {$sites[$i]['url']}"); exit; } } header("location: games.php"); // all hits set, reload and start over ?> If anyone could modify this script for me, please post the new code for games.php in this topic along with your paypal address and i will send you $20. Thanks Luke. Quote Link to comment https://forums.phpfreaks.com/topic/83579-php-hits-out-script-offering-20-to-the-solver-via-paypal/ Share on other sites More sharing options...
nuxy Posted December 29, 2007 Share Posted December 29, 2007 PHP Freelancers Section.. Quote Link to comment https://forums.phpfreaks.com/topic/83579-php-hits-out-script-offering-20-to-the-solver-via-paypal/#findComment-425220 Share on other sites More sharing options...
teng84 Posted December 29, 2007 Share Posted December 29, 2007 yes this should be on another section of this forum and your question is not that clear to give a good answer. Quote Link to comment https://forums.phpfreaks.com/topic/83579-php-hits-out-script-offering-20-to-the-solver-via-paypal/#findComment-425228 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.