Jump to content

[SOLVED] callbacks help


cody4camp

Recommended Posts

You should use $_GET.

 

$id = $_GET['snuid'];
$turns = $_GET['currency'];

 

i want it to modify my variable from the callback ping.

 

Not sure what this exactly means.

Link to comment
Share on other sites

ok heres what i want it to do, say the server calls back: http://www.pimp-battle.com/offerpal.php?snuid=1&currency=100

 

i want $id to equal snuid and $turns to equal currency, you solved that, but now i cant get it to actually add the credits.

 

 

will this work:

$id = $_GET['snuid'];
$turns = $_GET['currency'];

if{$turns > 5{

    $expires=$time+7776000;

        

//update database to add turns to user in game they bought for


// pinoywebdev add s
$expires = cln($expires);
$turns = cln($turns);
$custom = cln($custom);
$refcredit = cln($refcredit);
// pinoywebdev add e
        mysql_query("UPDATE $tab[user] SET status='supporter', statusexpire='$expires', credits=credits+$turns WHERE id='$id'");


}

 

Link to comment
Share on other sites

heres my full code, but still wont work:

 

<?

include("functions.php");

$id = $_GET['snuid'];
$turns = $_GET['currency'];

if($turns > 0){

    $expires=$time+7776000;

        

//update database to add turns to user in game they bought for



$expires = cln($expires);
$turns = cln($turns);
$id = cln($id);

        mysql_query("UPDATE $tab[user] SET status='supporter', statusexpire='$expires', credits=credits+$turns WHERE id='$id'");


}


  fclose ($fp);


?>

Link to comment
Share on other sites

heres my full code, but still wont work:

 

OK, well the GET method is correct as long as the URL is what you posted.

 

Why happens? 

What tells you it does work? 

Something doesn't happen, something does happen that's not supposed to?

Any Errors? 

What's the clr() function look like? 

Are you echoing out testing strings so you know what part got executed? 

Maybe it's your query?  Put or die(mysql_error()) at the end. 

Maybe it's a syntax error, put this directly after you opening <?php tag:

 

ini_set ("display_errors", "1");
error_reporting(E_ALL);

 

 

 

 

Link to comment
Share on other sites

What i am doing is implementing offerpal into my BBG

 

offerpal sends callbacks to my server when an offer got completed and credits the user with their credits.

 

when i test it it says this:

Test

 

We have just test fired a simulated transaction, please verify you got it and credited the currency to your end-users correctly:

 

Test was successful : HTTP return code (200)

http://www.pimp-battle.com/offerpal.php?snuid=29&currency=100

 

but it did not credit the currency.

Link to comment
Share on other sites

First echo something after your IF statement to see if it's even being executed.

 

If it is, then there's probably something wrong with your query, change it to:

        $sql = "UPDATE $tab[user] SET status='supporter', statusexpire='$expires', credits=credits+$turns WHERE id='$id'";
        echo "QUERY=> " . $sql;
        mysql_query($sql) or die(mysql_error());

 

and post what the output is.

 

EDIT: Put query in string, echoed it, then executed the query.

Link to comment
Share on other sites

new coder:

<?
ini_set ("display_errors", "1");
error_reporting(E_ALL);

include("functions.php");

$id = $_GET['snuid'];
$turns = $_GET['currency'];

if($turns > 0){

//update database to add turns to user in game they bought for
        mysql_query("UPDATE $tab[user] SET status='supporter', credits=credits+$turns WHERE id='$id'");


}


  fclose ($fp);


?>

 

still dont work, maybe its my if statement?

Link to comment
Share on other sites

error

 

Notice: Undefined variable: tab in /home/cody4cam/public_html/offerpal.php on line 13

Warning: mysql_query() [function.mysql-query]: Access denied for user 'cody4cam'@'localhost' (using password: NO) in /home/cody4cam/public_html/offerpal.php on line 13

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/cody4cam/public_html/offerpal.php on line 13
Access denied for user 'cody4cam'@'localhost' (using password: NO)

Link to comment
Share on other sites

ive edited alot, now i only got this error:

 

QUERY=> UPDATE 'user' SET credits=credits+200 WHERE id='29'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''user' SET credits=credits+200 WHERE id='29'' at line 1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.