I need to write a postback script that will run when executed by an affiliate network.
I am assuming its executed by cURL (isn't that the standard way for an aff network to send postback?).
Can I just do this?:
http://domain.com/1/postback.php <= This is the code below.
The postback isn't registering into my traffic source pixel, nor writing to my database.
I am assuming its executed by cURL (isn't that the standard way for an aff network to send postback?).
Can I just do this?:
Code:
POSTBACK LINK ENTERED INTO AFF NETWORK: http://domain.com/1/postback/?transaction_id=[SID]&status=[STS]
http://domain.com/1/postback.php <= This is the code below.
Code:
<?php
$transaction_id = $_GET['transaction_id'];
$status = $_GET['status'];
//CONNECT TO DATABASE
$username="username";
$password="password";
$database="database";
$con = mysql_connect("localhost",$username,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($database) or die( "Unable to select database");
//UPDATE SUCCESS status 1 is payable 2 is denied
if ($status == 1) {
mysql_query("Update offer1 SET success = '$status' WHERE transaction_id = '$transaction_id'");
//OTHER COMPANY PIXEL
echo <<<EOD
<!-- Offer Conversion -->
<img src="http://othercompanydomain.com/aff?offer_id=xxxxx&transaction_id=<?php echo $transaction_id; ?>" width="1" height="1" />
<!-- // End Conversion -->
EOD;
mysql_close($con);
}
else {
}
?>
The postback isn't registering into my traffic source pixel, nor writing to my database.