Hi Guys,
I am currently trying to add a hook to get both of these affiliate programs working with WHMCS,
The code I am using is as follows.
<?
function actionhook_InvoicePaid($vars) {
$result=mysql_query("SELECT amount FROM tblinvoiceitems WHERE type='HOSTING' AND invoiceid=$invoiceid");
$row = mysql_fetch_array($result);
if (!empty($_COOKIE['jrox'])){
$JAMIntegrate = file_get_contents("http://www.mydomain.com.au/jamaffiliates/sale.php?amount=".$row['amount']."&trans_id=".$vars."&custom_mid=".$_COOKIE['jrox']);
}
else{
#clixgalore Affiliate program
$method['image']="<img src='https://www.clixGalore.com/AdvTransaction.aspx?AdID=*****&SV={$row['amount']}&OID={$row['invoice_id']} '";
$method['image'].="height='0' width='0' border='0'>";
#Build Tracking image for Clix Galore
$buffer.=$method['image'];
$buffer.='<br />';
}
# Email for troubleshooting hook remove later
$to = me@mdomain.com.au";
$from = "sales@mydomain.com.au";
$from_header = "From: $from";
$subject = "WHMCS Troubleshooting affiliate script";
$message = "The following has been recorded by WHMCS hook jam.php \n\n Invoice ID: $row[invoice_id]";
mail($to, $subject, $message, $from_header);
add_hook("InvoicePaid",0,"actionhook_InvoicePaid","");
}
?>
When I try and complete a Clixgalore transaction after I log onto WHMCS I am presented with a blank page, this file is saved in the /includes/hooks directory as jam.php
If anyone has any ideas on what I have done wrong please advise your help will be much appreciated.
Thanks
Jamie.