Pocket Script

In this section, you will learn how to properly integrate Revlum in Pocket Script.

It takes less than 5 minutes to integrate Revlum into your Pocket Faucet Script. Let's get started.

1. Create a new file called - yourdomain.com/postbacks/revlum.php and enter the following piece of code

        

/*!
* POCKET v3.8
*
* http://www.droidoxy.com
* support@droidoxy.com
*
* Copyright DroidOXY ( http://www.droidoxy.com )
*/
	
include_once("../admin/core/init.inc.php");
	
// Retrieve the POST data
$user_id = $_POST['subId'];
$amount = $_POST['reward'];
$transId = $_POST['transId'];
$signature = $_POST['signature'];
    
$secret = ""; // Get your secret key from Revlum
// Validate Signature
if (md5($user_id . $transId . $amount . $secret) != $signature) {
    echo "ERROR: Signature doesn't match";
    return;
}

$timeCurrent = time();
$configs = new functions($dbo);
$type = "Revlum offerwall credit";

if ($userdata['username'] != $user_id) {
    api::printError(ERROR_UNKNOWN, "Account Mismatch");
} else {
    
    $newBalance = $userdata['points'] + $amount;
    
    // Updating user Points
    $sql  = "UPDATE users SET points = '$newBalance' WHERE login = '$user_id'";
    $stmt = $dbo->prepare($sql);
    $stmt->execute();
    
    // Updating user Tracker
    $sql  = "INSERT INTO tracker(username, points, type, date) values ('$user_id', '$amount', '$type', '$timeCurrent')";
    $stmt = $dbo->prepare($sql);
    
    if ($stmt->execute()) {
        $configs->sendPush($userdata['gcm'], "credit", $amount, "none", "none");
    }
    
    echo "1";
    
}
        

2. Your postback link is: https://yourdomain.com/postbacks/revlum.php