Hello I would like to know how can I redirect every 4th visitor to another website of mine. Suppose I get 100 visits to my website(Eg: mywebsite.com) <?php if(some condition){ header(Location: "http://mywebsite.com/link1.php"); else{ header(Location: "http://mywebsite.com/link2.php"); } ?> PHP: I would like to redirect 10% to one link and rest to another link. Can this be done ? Please help
ok let say we have 100% here we generate random number from 1 to 100. mt_rand(1,100); so you will put the condition if(mt_rand(1,100) <= 10) { //goto url that in 10 range } else { //goto url in 90 range }