MDizzleFresh Posted March 27, 2010 Share Posted March 27, 2010 Hello everyone. I am starting up a Facebook app, and I need help with coding the postback URL for my Super Rewards account. If someone can help me, please do! I have no clue how to even make the postback url page. I coded a php page, and uploaded it to my server, but the postback does not work. If someone can help me, or provide example postback codes, then it would be of great help! Link to comment https://forums.phpfreaks.com/topic/196683-postback-coding/ Share on other sites More sharing options...
MDizzleFresh Posted March 27, 2010 Author Share Posted March 27, 2010 By the way, I need the postback for when after a player completes an offer, or purchases points, then it goes to the postbackurl. Super Rewards is the program I am using Link to comment https://forums.phpfreaks.com/topic/196683-postback-coding/#findComment-1032640 Share on other sites More sharing options...
jskywalker Posted March 27, 2010 Share Posted March 27, 2010 googling revealed: http://www.makewebgames.com/free-plugins/29432-add-super-rewards-points-to-your-site/ It gives guidelines on creating the code, please be more specific on what 'is not working'.... Link to comment https://forums.phpfreaks.com/topic/196683-postback-coding/#findComment-1032642 Share on other sites More sharing options...
MDizzleFresh Posted March 27, 2010 Author Share Posted March 27, 2010 The points aren't being added to the account... Here is the new code I have: <? include("includes/clsGeneral.php"); //check md5 $SECRET = '**************************'; $sig = md5($_REQUEST['id'] . ':' . $_REQUEST['new'] . ':' . $_REQUEST['uid'] . ':' . $SECRET); if($_REQUEST['sig'] == $sig) { $userdata = GetUserInfo($_REQUEST['uid']); $conn = ConnectDB(); $res = mysql_query('UPDATE users SET king_author_points = '.$_REQUEST['total'].' WHERE id = '.$_REQUEST['uid'].''. $connection); if($res){ print "1"; }else{ print "0"; } }else{ print "0"; } Link to comment https://forums.phpfreaks.com/topic/196683-postback-coding/#findComment-1032651 Share on other sites More sharing options...
jskywalker Posted March 27, 2010 Share Posted March 27, 2010 $_REQUEST['sig'] == $sig [/code] Add some 'deubgging' lines to your code, so you can verify the values of the variables This way you can track down where is does something different than you are expecting... Link to comment https://forums.phpfreaks.com/topic/196683-postback-coding/#findComment-1032686 Share on other sites More sharing options...
MDizzleFresh Posted March 27, 2010 Author Share Posted March 27, 2010 Sorry, im a little new to coding. What do you mean by adding debugging lines to code? Link to comment https://forums.phpfreaks.com/topic/196683-postback-coding/#findComment-1032687 Share on other sites More sharing options...
jskywalker Posted March 27, 2010 Share Posted March 27, 2010 <? include("includes/clsGeneral.php"); //check md5 $SECRET = '**************************'; $sig = md5($_REQUEST['id'] . ':' . $_REQUEST['new'] . ':' . $_REQUEST['uid'] . ':' . $SECRET); $DEBUG=1; if ($DEBUG == 1) { echo "REQUEST: $_REQUEST['sig'] == $sig ? <br>\n"; } if($_REQUEST['sig'] == $sig) { $userdata = GetUserInfo($_REQUEST['uid']); if ($DEBUG == 1) { echo "USERDATA: $userdata <br>\n"; } $conn = ConnectDB(); $sql='UPDATE users SET king_author_points = '.$_REQUEST['total'].' WHERE id = '.$_REQUEST['uid'].''. $connection; if ($DEBUG == 1) { echo "SQL: $sql <br>\n"; } $res = mysql_query($sql); if($res){ print "1"; }else{ print "0"; } }else{ print "0"; } this way you will see some values on your screen or in your browser when thing are posted back. after testing you can change $DEBUG=1 to $dDEBUG=0, to stop debugging..... Link to comment https://forums.phpfreaks.com/topic/196683-postback-coding/#findComment-1032689 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.