
WP plugin redirect for split test endless loop?
I was looking for a plugin that can help with a split test for a product I am working on. However when I run this plugin it keeps going in an endless loop.
It sits there and switches between urls about every second or two and am not sure as to whats going on and what I can do to fix it.
If anyone can tell me whats going wrong I'd greatly appreciate it.
I am only going to post the main function of the code as the rest is rather irrelevant.
$domain1=get_option('domain1');
$domain2=get_option('domain2');
$ct = 0;
if(!empty($domain1) || $domain1 != null){
$ct=$ct+1;
}elseif(!empty($domain2) || $domain2 != null){
$ct=$ct+1;
}
$test = rand(0,$ct);
if($test == 0){
$location = $domain1;
}else{
$location = $domain2;
}
header("Location: ".$_SERVER['HTTP_HOST'].$location);
exit;
Do you want to make successes or excuses? Success? Alright then... See what's in store for you....
- The AC Assassin
Great Success is built from many little successes!
http://www.timbrownlaw.com - My Wee Part of the World.
http://www.LookingOverMyShoulder.com
Do you want to make successes or excuses? Success? Alright then... See what's in store for you....
- The AC Assassin
Do you want to make successes or excuses? Success? Alright then... See what's in store for you....
- The AC Assassin
Great Success is built from many little successes!
http://www.timbrownlaw.com - My Wee Part of the World.
http://www.LookingOverMyShoulder.com