Get exclusive CAP network offers from top brands

View CAP Offers

Reply To: redirect affiliate links

[bsa_pro_ad_space id=2]
#800796
Poker Zealot
Member

the script describes the main things and is very easy to use. But it wastes resources and may cause some error messages.
There are special cases not handled. What if you misspelled some client you want to link to. So you have to handle the case that no if query is successful.

A better one would be

if( …..){
header( ‘Location: link’);
exit;
} elseif (…..){
header( ‘Location: link’);
exit;
} else{
header( ‘Location: link’);
exit;
}

The else case will be used if no other query succeeds. This is neccessary as users may looking for weak points in your scripts and may change the URLs.
The elseif queries are much better as only one case can be successful. In the told script all queries are checked not relevant if the first one is successful already. Also it is not neccessary to store the link in a variable. It is much better to redirect directly and stop the script.