I have a script that I want to add some code to randomly add a charities affiliate id say 20% of the time randomly. 80% of the time a another affiliate id. How can this be done? Any help would be appreciated. Thanks
<?php $affiliate_id = 0; srand(time()); $random = rand() % 10; if($random <= 2) $affilliate_id = charity; else $affiliate_id = other_affiliate_id; ?> Code (markup): That would proably work
Thanks for the reply. I am not a programmer, but I will not study the config file and the function files of this script and see what I can figure out. Thanks again
is there a way to do this in htaccess. But instead of knowing the affiliate id of the users, hows about using some type of wild card to replace for example a clickbank id or amazom id? If this can be done via htaccess and done on a random basis that might work better. Any help much appreciated.