اقتباس:
المشاركة الأصلية كتبت بواسطة Iron.Man
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
postback.php ده بيحدد سعر الـ Donate او السيلك عموما
الكويري دي ممكن تساعدك
كود PHP:
<?php
require_once('SRPostbackHandler.class.php');
header('Content-Type:text/plain');
$sr_postback_handler = new SRPostbackHandler("00000000000000000000000000000000");
echo $sr_postback_handler->HandlePostback($_REQUEST['id'], $_REQUEST['uid'], $_REQUEST['oid'], $_REQUEST['new'], $_REQUEST['total'], $_REQUEST['sig']);
// This script will output a status code of 1 (Success) or 0 (Try sending again later).
?>
لو عايز تعدل عليه براحتك اتفضل
كود PHP:
<?php #--- Error reporting ---# error_reporting(-1); #--- Timezone status ---# date_default_timezone_set("Europe/Stockholm"); $SECRET_KEY = ""; // secret for my app $transaction_id = $_REQUEST['id']; $user_id = $_REQUEST['uid']; $offer_id = $_REQUEST['oid']; // completed offer or payment method $new_currency = $_REQUEST['new']; $hash_signature = $_REQUEST['sig'];
$hash = md5($transaction_id.':'.$new_currency.':'.$user_id.':'.$SECRET_KEY); if ($hash != $hash_signature) { // signature doesn't match, respond with a failure echo "0\n"; exit; } // all good! #--- Database connection ---# mssql_connect($serverIp, $userName, $password) or die("0\n"); #--- Select Database ---# mssql_select_db($dbName1) or die("0\n"); #--- Filter ---# $clean_html = htmlspecialchars($user_id); $clean_sql = str_replace("'", "", $clean_html); #--- INSERT SILK, NEW METHOD MAKAVELI PROZ0R ---# mssql_query("exec CGI.CGI_WebPurchaseSilk 0,'$clean_sql',0,'$new_currency',0") or die("0\n"); #--- Log payment ---# mssql_select_db($dbName5) or die("0\n"); mssql_query("INSERT INTO _SuperRewards (StrUserID, Silk, date) VALUES('$clean_sql', '$new_currency', '$date')"); log("User $clean_sql purchased $new_currency coins using $offer_id (txn: $transaction_id)\n"); echo "1\n"; ?>
|
طب معلش استحملني شويه هو ده الكلام اللى ف التكست اللى هما بعتوه ليا
<?php
/*
SuperRewards.com App Postback Handling Script for Publishers.
You will need a web server running PHP and a MySQL database (or MySQL-like database).
This script uses PHP's PDO which can be configured to use different database types.
Installation Instructions:
1. Fill in the configuration options below.
2. Place the script on your web server and make sure it is accessible from the Internet.
Ex: عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا
[ للتسجيل اضغط هنا ]
3. Automatically setup the database tables for use with this script by passing the setup option in the URL.
Ex: عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا
[ للتسجيل اضغط هنا ]
4. Test your integration by sending a Test Postback.
See: عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا
[ للتسجيل اضغط هنا ]
5. Use the information in the database to award in-game currency to your users.
For more details, see our documentation at:
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا
[ للتسجيل اضغط هنا ]
*/
define('APP_SECRET', 'b75b2fc7f377c18b95ccd5a65b44c9dc'); // App Secret Key. Find it by going to the Apps page, select Edit on the App of your choice, then Integrate.
define('DB_USER', '7omos'); // Your database user.
define('DB_PASSWORD', 'haMzA$#TesT@RRR%'); // Your database password.
define('DB_HOST', '136.243.17.175'); // Your database host (usually 127.0.0.1).
define('DB_HOST_PORT', '39000'); // Your database host port (usually 3306).
define('DB_NAME', 'WIN-S1R7RLB24F1'); // Your database name.
define('DB_PREFIX', ''); // OPTIONAL: A database table prefix, such as 'app1_'. This easily allows multiple apps to be served from the same database.
error_reporting(E_WARNING);
// *** No more configuration below this line. ***
header('Content-Type:text/plain');
// If &setup is passed in, setup tables needed to use this script.
if(isset($_REQUEST['setup']))
{
$query =
"CREATE TABLE IF NOT EXISTS `".DB_PREFIX."transactions` (
`id` INT NOT NULL,
`uid` BIGINT,
`oid` INT,
`new` INT,
`time` DATETIME,
PRIMARY KEY (`id`))
CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE TABLE IF NOT EXISTS `".DB_PREFIX."users` (
`uid` BIGINT NOT NULL,
`total` INT,
`time` DATETIME,
PRIMARY KEY (`uid`))
CHARACTER SET utf8 COLLATE utf8_general_ci;";
try
{
// Connect to Database.
$dbh = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME.";por t=".DB_HOST_PORT, DB_USER, DB_PASSWORD, array( PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING ));
$query = $dbh->prepare($query);
if(!$query->execute())
echo "Could not create tables in database: ".DB_NAME." @ ".DB_HOST.'. Check your configuration above.';
else
echo "Tables setup successfully!";
$dbh = null;
}
catch (PDOException $e)
{
exit($e->getMessage());
}
exit();
}
$id = $_REQUEST['id']; // ID of this transaction.
$uid = $_REQUEST['uid']; // ID of the user which performed this transaction.
$oid = $_REQUEST['oid']; // ID of the offer or direct payment method.
$new = $_REQUEST['new']; // Number of in-game currency your user has earned by completing this offer.
$total = $_REQUEST['total']; // Total number of in-game currency your user has earned on this App.
$sig = $_REQUEST['sig']; // Security hash used to verify the authenticity of the postback.
/**
* Sanity check.
*
* If you are using alphanumeric user ids, remove the is_numeric($uid) check. Alphanumeric
* ids can only be enabled by Super Rewards Support
*
* If you are using alphanumeric user ids, please ensure that you use the appropriate URL-encoding
* for non-text or unicode characters. For example: ~ should be encoded as %7E
*/
if(!(is_numeric($id) && is_numeric($uid) && is_numeric($oid) && is_numeric($new) && is_numeric($total)))
exit('0'); // Fail.
$result = 1;
$sig_compare = md5($id.':'.$new.':'.$uid.':'.APP_SECRET);
// Only accept if the Security Hash matches what we have.
if($sig == $sig_compare)
{
$timestamp = date("Y-m-d H:i:s", time());
try
{
// Connect to Database.
$dbh = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME.";por t=".DB_HOST_PORT, DB_USER, DB_PASSWORD, array( PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING ));
// Add new transaction
$query = $dbh->prepare("INSERT INTO ".DB_PREFIX."transactions(id, uid, oid, new, time) VALUES (:id,:uid,:oid,:new,:time) ON DUPLICATE KEY UPDATE id=:id,uid=:uid,oid=:oid,new=:new,time=:time");
$query->bindParam(':id', $id, PDO::PARAM_INT);
$query->bindParam(':uid', $uid, PDO::PARAM_INT);
$query->bindParam(':oid', $oid, PDO::PARAM_INT);
$query->bindParam(':new', $new, PDO::PARAM_INT);
$query->bindParam(':time', $timestamp, PDO::PARAM_STR);
if(!$query->execute())
$result = 0; // Problems executing SQL. Fail.
// Add/Update user.
$query = $dbh->prepare("INSERT INTO ".DB_PREFIX."users(uid, total, time) VALUES (:uid,:total,:time) ON DUPLICATE KEY UPDATE uid=:uid,total=:total,time=:time");
$query->bindParam(':uid', $uid, PDO::PARAM_INT);
$query->bindParam(':total', $total, PDO::PARAM_INT);
$query->bindParam(':time', $timestamp, PDO::PARAM_STR);
if(!$query->execute())
$result = 0; // Problems executing SQL. Fail.
$dbh = null;
}
catch (PDOException $e)
{
exit($e->getMessage());
}
}
else
$result = 0; // Security hash incorrect. Fail.
echo $result;
// This script will output a status code of 1 (Success) or 0 (Try sending again later).
?>
دا انا اعمل فيه ايه اعدل فين بالظبط
والملف نفسه بحطه فين
و كمان انا عندي ف الداتا بيز ف SRO_VT_ACCOUNT
table اسمه SK_SilkBuyList
مش ده بتاع الشراء اللى المفروض البوست باك بيحول البيانات عليه ؟؟