Hi. I'm using a IPN code, so everytime a users buys he passe's into this file.
What's suppose to happen: In the USERS table, there's a column called Dollares (it's the coins they recieve). It's suppose the user buys for ex. 10 dollares (coins) - $points, through paygol.
$points are the ammount of dollares (coins) they buy.
I want them to recieve the dollares (coins) + the dollares they had before.
When the users buys paygol generates through $points the ammount of dollares they buy.
Can you help me? I used this, it didn't work. What's wrong in this script:
What's suppose to happen: In the USERS table, there's a column called Dollares (it's the coins they recieve). It's suppose the user buys for ex. 10 dollares (coins) - $points, through paygol.
$points are the ammount of dollares (coins) they buy.
I want them to recieve the dollares (coins) + the dollares they had before.
When the users buys paygol generates through $points the ammount of dollares they buy.
Can you help me? I used this, it didn't work. What's wrong in this script:
Code:
<?php
require_once('./data_classes/server-data.php_data_classes-core.php.php');
require_once('./data_classes/server-data.php_data_classes-session.php.php');
//check that the request comes from PayGol server
if(!in_array($_SERVER['REMOTE_ADDR'],
array('109.70.3.48', '109.70.3.146', '109.70.3.58'))) {
header("HTTP/1.0 403 Forbidden");
die("Error: Unknown IP");
}
// get the variables from PayGol system
$message_id = $_GET['message_id'];
$service_id = $_GET['service_id'];
$shortcode = $_GET['shortcode'];
$keyword = $_GET['keyword'];
$message = $_GET['message'];
$sender = $_GET['sender'];
$operator = $_GET['operator'];
$country = $_GET['country'];
$custom = $_GET['custom'];
$points = $_GET['points'];
$price = $_GET['price'];
$currency = $_GET['currency'];
//Connect to DB
$connection = mysql_connect($host, $username, $password);
$db= mysql_select_db($dbname);
//Ver dolares que ja tinha
$sql = "SELECT dolares FROM users WHERE username='".$name."'";
$result= mysql_query($sql);
$row = mysql_fetch_assoc($result);
//Pegar Dolares
$dolares = $row[dolares];
//Seila
$coins = $dolares + $points;
mysql_query("UPDATE users SET dolares=".$coins." WHERE username='". $name ."'");
?>
Last edited: