Hello all, 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.
WP plugin redirect for split test endless loop?
9
Hello all,
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.
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.
PHP Code:
$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;
- johnnyN
- [1] reply
- jaybaker
- [2] replies
- jaybaker
- rufaswan
- [ 1 ] Thanks
- Tim Brownlaw
- [ 1 ] Thanks
Next Topics on Trending Feed
-
9