PHP Gurus, Please Help with my script.
For example. I have a number of different affiliate offers for a free credit report and I want to send each non banned IPs to a randomly chosen URL so each affiliate offer will get some traffic and hopefully some sales.
Below is the code I have already written. If someone could help show me how to make it do the random URL thing, I would appreciate it.
<?php $banned_ip = array(); $banned_ip[] = '204.96.148.3'; $banned_ip[] = '205.162.217.141'; foreach($banned_ip as $banned) { $ip = $_SERVER['REMOTE_ADDR']; if($ip == $banned) { header("location: hxxp://you-are-banned.com"); die();//abort the script on redirect. just in case. } } //if we got this far, their IP is obviously not banned //this is where I would like it to have numerous URLs to randomly send each visitor to one of them header("location: hxxp://freecreditreport1.com"); ?>
-
gcornelisse -
Thanks
{{ DiscussionBoard.errors[353385].message }} -
-
tufats -
Thanks - 1 reply
{{ DiscussionBoard.errors[353629].message }}-
gcornelisse -
Thanks
{{ DiscussionBoard.errors[353866].message }} -
-
-
Jenniferlinn Banned-
Thanks
{{ DiscussionBoard.errors[361690].message }} -
-
thehypnoguy2 -
Thanks - 1 reply
{{ DiscussionBoard.errors[388922].message }}-
Bruce Hearder -
Thanks
{{ DiscussionBoard.errors[443825].message }} -
-
-
Bruce Hearder -
Thanks
{{ DiscussionBoard.errors[445426].message }} -