PDA

View Full Version : A tiny PHP script that can increase your income a couple percentages.


Unknown
10-11-2001, 07:36 AM
<?
$fp = fsockopen("www.processor1.com", 80, &$errno, &$errstr, 30);
if(!$fp){
header("Location: <A HREF="http://www.processor2.com/?blablalinkingcode");" TARGET=_blank>http://www.processor2.com/?blablalinkingcode");</A>
}else{
header("Location: <A HREF="http://www.processor1.com/?blablalinkingcode");" TARGET=_blank>http://www.processor1.com/?blablalinkingcode");</A>
}
?&gt;

With this script your visitors will automaticly go to your secondary processor join page if your main one is down. The big processors are not often down, but they do sometimes and then this script will save the joins during this time so you don't lose any income.

To use it you must edit URL's ofcourse, save to join.php or whatever and link to it instead of directly to processor join link.

I am thinking of making a full-fletched processor script that automaticly send join form information to secondary processor if the main one output specific text, like "Sorry, your CC number is not accepted" or "We are having technically difficulties, try again later" etc. I know it can be done for sure - very easily infact. Is it already done or what? I don't want to reinvent the wheel so to say - lol. :)

Unknown
10-11-2001, 07:56 AM
If you use 3 processors, (Aren't we paranoid today! ;))use this:

&lt;?
$fp = fsockopen("www.processor1.com", 80, &$errno, &$errstr, 30);
if(!$fp){
$fp2 = fsockopen("www.processor2.com", 80, &$errno, &$errstr, 30);
if(!$fp2){
header("Location: <A HREF="http://www.processor3.com/?blablalinkingcode");" TARGET=_blank>http://www.processor3.com/?blablalinkingcode");</A>
}else{
header("Location: <A HREF="http://www.processor2.com/?blablalinkingcode");" TARGET=_blank>http://www.processor2.com/?blablalinkingcode");</A>
}
}else{
header("Location: <A HREF="http://www.processor1.com/?blablalinkingcode");" TARGET=_blank>http://www.processor1.com/?blablalinkingcode");</A>
}
?&gt;

Just trying to make myself useful! :)