I want to include an offer wall on my website using the code below.
<iframe src="[login to view URL]" frameborder="0" width="860" height="2400" ></iframe>
I need to replace the "YOUR_USER_ID" with a unique user id generated when users sign up.
I will also need help with the postback setup-
Example of post back code:
Very Important: Our system expects a "1" (number one) without quotes as the sole response to our Postback request.
Sample PHP Postback Script
<?php
/*
* Postback Example - [login to view URL]
*
*/
$your_app_key = "your_app_key_find_it_in_Integrate_section_of_your_account";
// Your database credentials.
define("MYSQL_HOST", "localhost");
define("MYSQL_PORT", "3306");
define("MYSQL_DB", "your_db");
define("MYSQL_TABLE", "your_table");
define("MYSQL_USER", "username");
define("MYSQL_PASS", "password");
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);
if ($mysqli->connect_errno)
{
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
// Get Postback variables, for a complete list of list of variables, please go to [login to view URL] Postback tab
$transaction_id = urldecode($_GET["transaction_id"]);
$offer_id = urldecode($_GET["offer_id"]);
$offer_name = urldecode($_GET["offer_name"]);
$amount = urldecode($_GET["amount"]); //This is what your user is paid in your virtual currency, for example 300 coins
$virtual_currency = urldecode($_GET["virtual_currency"]); // This is simply the name of the currency of your app
$userid = urldecode($_GET["userid"]); //
$signature = urldecode($_GET["signature"]);
$payout = urldecode($_GET["payout"]);
$subid1 = urldecode($_GET["subid1"]);
$subid2 = urldecode($_GET["subid2"]);
$subid3 = urldecode($_GET["subid3"]);
//Check the signature
$my_signature = md5($transaction_id."/".$offer_id."/".$your_app_key);
if($my_signature != trim($signature)){
//Signatures don't match
echo "0";
exit(0);
}
//Possible make some other checks like if userid is actually a user in your system...
//then simply award the coins to your user
$sql = "UPDATE ".MYSQL_TABLE." SET coins=coins+".$mysqli->real_escape_string($amount)." WHERE userid = ".$mysqli->real_escape_string($userid);
$result = $mysqli->query($sql);
if($result){
echo "1";
}else{
echo "0";
}
exit(0);
?>
This post back will then affect the users balance.
hi there !
i am expert of core php and mysql and surely provide your proper solution , please start chat session as i need to ask something about your project .
thanks
Muhammad imran
I have worked on similar project before where customers would complete survey and watch adverts and in return would receive credits on the website.
I have a great experience with mysql database/php and I will write all of code in mvc to ensure clean code is written.