Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-21-2009, 11:35 PM   #1
qxm
Confirmed User
 
Join Date: Jul 2006
Location: NoHo
Posts: 5,970
Any PHP Guys here tonight? Quick Question...

I need to test 3 landing pages with one domain... I currently have a simple php "if > else" statement on index.php that sends 50/50 to each LP .. here it is:

PHP Code:
<?php
if(rand(0,1) == 0) {
header("Location: http://www.domain.com/landingpage1.html");
} else {
header("Location: http://www.domain.com/landingpage2.html");
}
?>
I was wondering how to ad a third page in there or if I have to change to an array type of thing.... .I was googling this stuff but couldn't find something other than a 50/50 split test...

What I am trying to avoid is to use a dynamic link such as domain.com/?id=landing1.html to test these 3 pages.. .instead I'd like to send traffic to domain.com and have some php code split the traffic...

Any ideas? ...




</NO trolls pls I am workin late and don't have time for ur shit, thanks>
__________________

ICQ: 266990876
qxm is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-21-2009, 11:43 PM   #2
alexwoj
Registered User
 
Join Date: Jun 2006
Location: Porto Alegre, RS - Brazil
Posts: 12
Hello!

I dont know if you wan't to try conversions. But if the answer is YES, you can try google optimizer. I have used it to test 5 tours, and it told me the tour that converted better for my paysite. You configure the tours, and the goal. It will tell you the tour that sends more users to the goal page.

Search for google optimizer and try it.

Sorry, cannot help you with the PHP code right now, because I am drinking some whisky and its almost 4 AM. But if you dont find any answer please PM me and tomorrow I can help you. And try google optimizer.


See ya

Alex
__________________
[]´s
Alexwoj from Brazil
http://megacash.warpnet.com.br

Adult Paysites, Affiliate Programs, Web Hosting and Internet Marketing in Brazil, since 1997.
alexwoj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-21-2009, 11:47 PM   #3
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Here's a real simple way to do it:

Code:
<?php
$urlArray = array(
  "http://whatever",
  "http://whatever",
  "http://whatever",
  "http://whatever",
  "http://whatever",
  "http://whatever",
  "http://whatever",
);

header("location: ".$urlArray[mt_rand(0, count($urlArray)-1)]);
?>
This doesn't do that great for weighting.

If you want to do some weighting, some pseudo code (ugly) could be as follows:

Code:
$count = ceil(100/count($urlArray));
$randchoice=rand(count($urlArray)%$count,0)-1;
Never did bother checking the graulatity of the above code snippit in practice, though, though. It should give roughly an even (rounded up) percentage to either one, since PHP's rand() tends to suck with smaller subsets.

Make DAMN sure you just use a location: redirect, which is a 301. Google won't penalize you for those.
__________________

Last edited by GrouchyAdmin; 09-21-2009 at 11:48 PM..
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-21-2009, 11:47 PM   #4
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
$link1='<somewhere>';
$link2='<somewhere>';
$link3='<somewhere>';

function getRandom(){
$r=rand(1,3);
return $r;
}

switch (getRandom()) {
case 1:
$theLink=$link 1;
break;
case 2:
$theLink=$link2;
break;
case 3:
$theLink=$link3;
break;
}

header $theLink
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-21-2009, 11:48 PM   #5
plsureking
bored
 
plsureking's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: PORNCMS.com
Posts: 4,720
just make rand a variable before your if statement. u can also use switch instead of if to make it easier to add more options.
__________________
#
plsureking is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2009, 12:12 AM   #6
qxm
Confirmed User
 
Join Date: Jul 2006
Location: NoHo
Posts: 5,970
thanks Grouchy/Fartfly .... I'll try those out...
__________________

ICQ: 266990876
qxm is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.