It's pretty easy. You add your links into the script. Then you put 1st.php and 2nd.php into the root of your wh domain. Make sure that 1st.php points to
www.whdomain.com/2nd.php. 2nd.php will have your affiliate links in it.
Then you set up your bh domain links pointing to
www.whdomain.com/1st.php
You should know that it's not ideal. I've been busted using it (don't ask me how). It might have been because the CPA network actually called the customer and the customer told them.
Most importantly you'll lose A LOT of traffic from browsers that won't clean the referrer - they'll just get caught in the loop.