Jump to content
MakeWebGames

Recommended Posts

Posted

ok ave got a super rewards on my site but wen i postback i dont get the points but its going in to the db ??? some help plz

heres my code

<?PHP
include 'dbcon.php';
include 'classes.php';

$earn = ($_GET['new']);
$id = ($_GET['id']);
$totaluser = ($_GET['total']);
$offerid = ($_GET['oid']);
store_lead($_GET['oid'], $_GET['id'], $_GET['total'], $_GET['new']); 

echo 1;


//store_lead function in classes.php//
function store_lead($offerid, $id, $totaluser, $earn){
$result = mysql_query("SELECT * FROM `offers` WHERE `oid`='{$offerid}', `id`='{$id}', `total`='{$totaluser}', `new`='{$earn}'");

$result = mysql_query("INSERT INTO `offers` (`oid`, `id`, `total`, `new`) VALUES ('$offerid', '$id', '$totaluser', '$earn')");


 $result1 = mysql_query("UPDATE `grpgusers` SET `points` = '$points + $earn WHERE `id`='".$id."'"); //give user points//

} 

?>
Posted

RE: post back

try this it should work

<?PHP
include 'dbcon.php';
include 'classes.php';

$earn = ($_GET['new']);
$id = ($_GET['id']);
$totaluser = ($_GET['total']);
$offerid = ($_GET['oid']);
store_lead($_GET['oid'], $_GET['id'], $_GET['total'], $_GET['new']); 

echo 1;


//store_lead function in classes.php//
function store_lead($offerid, $id, $totaluser, $earn){
 $result = mysql_query("SELECT * FROM `offers` WHERE `oid`='{$offerid}',  `id`='{$id}', `total`='{$totaluser}', `new`='{$earn}'");

$result = mysql_query("INSERT INTO `offers` (`oid`, `id`, `total`, `new`) VALUES ('$offerid', '$id', '$totaluser', '$earn')");


 $result1 = mysql_query("UPDATE `grpgusers` SET `points`=`points`+({$earn}) WHERE `id`='".$id."'"); //this line was edited

} 

?>
Posted
try this it should work
include 'dbcon.php';
include 'classes.php';

$earn = ($_GET['new']);
$id = ($_GET['id']);
$totaluser = ($_GET['total']);
$offerid = ($_GET['oid']);
store_lead($_GET['oid'], $_GET['id'], $_GET['total'], $_GET['new']); 

echo 1;


//store_lead function in classes.php//
function store_lead($offerid, $id, $totaluser, $earn){
 $result = mysql_query("SELECT * FROM `offers` WHERE `oid`='{$offerid}',  `id`='{$id}', `total`='{$totaluser}', `new`='{$earn}'");

$result = mysql_query("INSERT INTO `offers` (`oid`, `id`, `total`, `new`) VALUES ('$offerid', '$id', '$totaluser', '$earn')");


 $result1 = mysql_query("UPDATE `grpgusers` SET `points`=`points`+({$earn}) WHERE `id`='".$id."'"); //this line was edited

} 

?>
thanks it works a dream :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...