Whatsup boys.
So basically I'm doing paygol implemention and this is confusing me abit.
When you go to paid.php?custom=Berkay&item=SVIP ,
it should update user Berkay's (habshit plus db) rank_vip to 1 and add a row into purchase_logs table.
Everything is fine, but.
purchase_logs contains this:
-------------------------------------------
id | name | username | approver |
----------------------------------------------------
1 | GVIP | Berkay2 | Shop Staff |
The sql:
for this case $item = "SVIP" and it should add the name SVIP. but it adds each row as ES and its much annoying.
Full paid.php page:
So basically I'm doing paygol implemention and this is confusing me abit.
When you go to paid.php?custom=Berkay&item=SVIP ,
it should update user Berkay's (habshit plus db) rank_vip to 1 and add a row into purchase_logs table.
Everything is fine, but.
purchase_logs contains this:
-------------------------------------------
id | name | username | approver |
----------------------------------------------------
1 | GVIP | Berkay2 | Shop Staff |
The sql:
PHP:
$con->query("INSERT INTO purchase_logs(name,username,approver) VALUES('$item','$custom', '')");
Full paid.php page:
Code:
<?php
include("connect.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.210'))) {
header("HTTP/1.0 403 Forbidden");
die("Nice try.Fuck off now.");
}
*/
// get the variables from PayGol system
$transaction_id = $_GET['transaction_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'];
$item = $_GET['item'];
if($item = "GVIP") {
$con->query("UPDATE users SET rank_vip = '2' WHERE username = ". $custom ."");}
if($item = "SVIP") {
$con->query("UPDATE users SET rank_vip = '1' WHERE username = ".$custom. "");
}
if($item = "ES"){
$con->query("UPDATE users SET rank_vip = 3 WHERE username = " . $custom . "");
}
$con->query("INSERT INTO purchase_logs(name,username,approver) VALUES('$item','$custom', '')");
echo $con->error;
include("checkban.php");
header("Location: success.php");
?>
Last edited: