βοΈPostback
Experience a seamless journey towards setting up your own Postback as we walk you through each step, providing comprehensive guidance along the way.
Last updated
<?php
/*!
* ClickWall LLC
* http://clickwall.net
* mail@dclickwall.net
* Demo: https://example.com/postback/clickwall.php?user_id={user_id}&amount={amount}&offer_name={offer_name}&user_ip={user_ip}
*/
// Include the initialization file
include_once("../admin/core/init.inc.php");
// Get data from the request
$user_id = $_REQUEST['user_id'];
$amount = $_REQUEST['amount'];
$offerName = $_REQUEST['offer_name'];
$user_ip = $_REQUEST['user_ip'];
// Get the current timestamp
$timeCurrent = time();
// Initialize the functions object
$configs = new functions($dbo);
// Define the event type
$type = "ClickWall: Offername: $offerName . IP: $user_ip";
// Create an account object and retrieve user data
$account = new account($dbo, 1);
$userdata = $account->getuserdata($user_id);
// Calculate the new user balance
$newBalance = $userdata['points'] + $amount;
// Update user Points
$sql = "UPDATE users SET points = '$newBalance' WHERE login = '$user_id'";
$stmt = $dbo->prepare($sql);
$stmt->execute();
// Update user Tracker
$sql = "INSERT INTO tracker(username, points, type, date) values ('$user_id', '$amount', '$type', '$timeCurrent')";
$stmt = $dbo->prepare($sql);
$stmt->execute();
if ($stmt) {
echo "OK";
}
?>