· 7 years ago · Sep 04, 2018, 07:06 PM
1<?php
2$secret_key = 'caf1e26ea36068e2194d211a27eb56ef';
3// Persona.ly server IP addresses
4$allowed_ips = array(
5 '162.243.242.7',
6 '162.243.34.227',
7 '52.200.142.249',
8);
9// Proceess only requests from Persona.ly IP addresses
10// This is optional validation
11if (!in_array($_SERVER['REMOTE_ADDR'], $allowed_ips)) {
12 echo 0;
13 die();
14}
15
16// Get params
17$user_id = $_REQUEST['user_id'];
18$amount = $_REQUEST['amount'];
19$offer_id = $_REQUEST['offer_id'];
20$app_hash = $_REQUEST['app_id'];
21$signature = $_REQUEST['signature'];
22$offer_name = $_REQUEST['offer_name'];
23// Create validation signature
24$validation_signature = md5($user_id . ':' . $app_hash . ':' . $secret_key); // the app_hash can be found in your app settings
25if ($signature != $validation_signature) {
26 // Signatures not equal - send error code
27 echo 0;
28 die();
29}
30// Validation was successful. Credit user process.
31 require '../link.php';
32 $inserting_offer_personaly = mysql_query("INSERT INTO offers (offerid, userid, amount) VALUES (".$offer_id.", ".$user_id.", ".$amount.")");
33 $setting_user_coins_personaly = mysql_query("UPDATE users SET user_coins= user_coins + ".$amount." WHERE steamid='".$user_id."'");
34 $setting_user_withdraw_status_personaly = mysql_query("UPDATE users SET withdraw_status='1' WHERE steamid='".$user_id."'");
35 $insert_action = mysql_query("INSERT INTO `actions`(`steamid`, `action`,`amount`,`offerwall`) VALUES (".$user_id.", 'survey', ".$amount.", 'Personaly')");
36echo 1;
37die();
38?>