Split testing landing pages

I've been doing affiliate marketing full time for a little over 2 years now, but one thing I haven't done is landing page split testing. Mainly because I'm not sure the best way to go about it. I'm interested in hearing how other advertisers are doing this.
The way I see it, there are 2 ways to do this.
Create 2 different versions of a landing page and run one for a certain length of time and then run the second one for the same amount of time and see which one converts best or you could use a script like this and test both at the same time.
<?php
if(rand(0,1) == 0) {
header("Location: http://www.example.com/split1");
} else {
header("Location: http://www.example.com/split2");
}
?>
If you were using a script like this, I guess you would need to add something extra to the SID code so you would know which page the lead came from.
Also, if you're doing landing page split testing, do you start doing it from the first day you start a campaign, or do you let the campaign run for a little while and weed out the keywords that are going to lose you money and then once the campaign is optomized, use this as a fine tuning technique.?
James
