Ask Cần người giúp code postback

PartnerVH

Banned
Joined
Dec 14, 2013
Messages
170
Reactions
66
MR
0.000
Follow me on Facebook Chat with me via Skype X.com
Hiện tại mình code dc 1 app android, nhưng phần lại kẹt phần code postback! bác nào rành thì giúp e với e xin hậu tạ :(
( Mod di ngang sữa tiêu đề dùm em là " Cần người code postback cho android app " dùm em phát
 

moneyaz

Senior
Joined
Mar 19, 2013
Messages
536
Reactions
267
MR
0.001
Chat with me via Skype
Hiện tại mình code dc 1 app android, nhưng phần lại kẹt phần code postback! bác nào rành thì giúp e với e xin hậu tạ :(
( Mod di ngang sữa tiêu đề dùm em là " Cần người code postback cho android app " dùm em phát

Postback thi can lam server. offer lead > net goi postback > luu ve server > call google cloud messenger > notify thiet bi
 

rocketpro

Banned
Joined
Aug 16, 2014
Messages
192
Reactions
90
MR
0.000
Chat with me via Skype
<?php

/*
Yousite Walls Postback Script
Section: Walls
Developed by Yousite.com

Note: This is an example postback script, it can be edited according to user site requirements.
Example Postback URL: http://yourdomain.com/script.php?sid=%SID%&sid2=%SID2%&status=%STATUS%&vc=%VC% (This script is coded according to this example url format, we will use sid variable as its set in url)
Dont forget to include your functions / db configuration and other necessary files required by your site like database configuration to perform sql queries.

*/


$allowed_IP = '72.9.148.195'; //Valid Yousite Postback Server IP Address
$ip = $_SERVER['REMOTE_ADDR']; //your postback hosting server ip
$sid = $_GET['sid']; // SubId
$sid2 = $_GET['sid2']; //Subid 2
$status = $_GET['status']; //1 - success, 2 - revoked
$vc = $_GET['vc']; //Virtual Currency Value


//These variables are not set in url, these are optional, if you didn't set these vars in postback url, you can remove these variables
$sid3 = $_GET['sid3']; //Subid 3
$sid4 = $_GET['sid4']; //Subid 4
$sid5 = $_GET['sid5']; //Subid 5
//-------------------------------------//


// validate postback source, if its not from Yousite, then stop script
if($ip != $allowed_IP)
die("Unauthorized Access!!!");


//Postback Authorized, Now you can code below according to your site needs ..






if($status == 1){ //Lead Confirmed

//Example of crediting user
$sql = "UPDATE users SET balance = balance+$vc WHERE uid = '$sid' AND code = '$sid2'";
if(mysql_query($sql))
{
echo "User Credited.";
}else
{
echo "Error...";
}


}elseif($status == 2) //Lead Reversed
{

//Example Of Credits Deduction

$sql = "UPDATE users SET balance = balance-$vc WHERE uid = '$sid' AND code = '$sid2'";

if(mysql_query($sql))
{
echo "User Credits Deducted.";
}else
{
echo "Error...";
}


}





?>
:D
 

Announcements

Forum statistics

Threads
426,451
Messages
7,177,184
Members
178,881
Latest member
toiDiTimSuPhu

Most viewed of week

Most discussed of week

Most viewed of week

Most discussed of week

Back
Top Bottom