Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server
You last visited: Today at 20:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Anyone helps me in this code plz

Discussion on Anyone helps me in this code plz within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2011
Posts: 13
Received Thanks: 6
Anyone helps me in this code plz

Hello !

I have Silkroad private server and my website donation on superrewards
but I can't make Postback I already contact with superrewards team but said
you need coder so I now ask here for helping
this is my postback code what's wrong with it ?
plz anyone help me
PHP Code:
<?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: http://www.example.com/app/postback.php
    3. Automatically setup the database tables for use with this script by passing the setup option in the URL. 
        Ex: http://www.example.com/app/postback.php?setup=1 
    4. Test your integration by sending a Test Postback. 
        See: http://docs.superrewards.com/v1.0/docs/notification-postbacks
    5. Use the information in the database to award in-game currency to your users.
    For more details, see our documentation at: 
    http://docs.superrewards.com/v1.0/docs/getting-started
*/
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''I deleted i'); // 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.";port=".DB_HOST_PORTDB_USERDB_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.";port=".DB_HOST_PORTDB_USERDB_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'$idPDO::PARAM_INT);
        
$query->bindParam(':uid'$uidPDO::PARAM_INT);
        
$query->bindParam(':oid'$oidPDO::PARAM_INT);
        
$query->bindParam(':new'$newPDO::PARAM_INT);
        
$query->bindParam(':time'$timestampPDO::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'$uidPDO::PARAM_INT);
        
$query->bindParam(':total'$totalPDO::PARAM_INT);
        
$query->bindParam(':time'$timestampPDO::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).
?>
when I enter on my website "http://www."mywebsite".com/postback.php?setup=1" this message appear " Mysql has gone away "

plz help me

anyone help me plz
mahmoodrabie26 is offline  
Old 08/20/2017, 07:06   #2
 
elite*gold: 0
Join Date: May 2011
Posts: 13
Received Thanks: 6
help me plz
mahmoodrabie26 is offline  
Old 08/20/2017, 07:14   #3
 
elite*gold: 0
Join Date: Feb 2016
Posts: 652
Received Thanks: 342
enable the mysql extension it might be the issue.
i want to see the full code because its like that if the php can't connect to ur mysql database then show message > 'Mysql has gone away'
EdwardTeach+- is offline  
Old 08/20/2017, 07:15   #4
 
thefear511's Avatar
 
elite*gold: 0
Join Date: Nov 2012
Posts: 948
Received Thanks: 259
bump , good luck ^^
thefear511 is offline  
Thanks
1 User
Old 08/20/2017, 14:10   #5
 
elite*gold: 0
Join Date: May 2011
Posts: 13
Received Thanks: 6
Quote:
Originally Posted by EdwardTeach+- View Post
enable the mysql extension it might be the issue.
i want to see the full code because its like that if the php can't connect to ur mysql database then show message > 'Mysql has gone away'
can you help me with teamviewer ?

or this my config.php
PHP Code:
<?php
include("sql.php");
include(
"recaptchalib.php");
error_reporting(0);
$publickey  "b75b2fc7f377c18b95ccd5a65b44c9dc";
$privatekey "b75b2fc7f377c18b95ccd5a65b44c9dc";
#########################################################################
###########################Edit this#####################################
######################################################################### 
$host                   "WIN-S1R7RLB24F1";
$user                   "7omos";
$password               "haMzA$#TesT@RRR%";
$database1              "SRO_VT_ACCOUNT";
$database2              "SRO_VT_SHARD";
$database3              "SRO_VT_SHARDLOG";
#########################################################################
###########################Don't touch this##############################
#########################################################################                     
$connectioninfo['Host'] = "$host";
$connectioninfo['User'] = "$user";
$connectioninfo['Pass'] = "$password";
$sql                    = new SQL($connectioninfotrue);
$sql->selectDB($database1);
?>
and the postback code was from superrewards website !
mahmoodrabie26 is offline  
Reply


Similar Threads Similar Threads
PLZ PLZ PLZ MAKE A ZP HACK IM BGGING PLZ
06/21/2010 - CrossFire - 7 Replies
MAKE A ZP HACK PLZ AND PLZ AND LZ I REAY NEED ZP CROSS FIRE WOULD GET PISSED OFF IF U MADE A ZP HACK PLZ MAKEONE THANK U
[HELP] plz plz plz ineed Source clinet 5065 plz
05/23/2009 - CO2 Private Server - 4 Replies
plz plz plz ineed Source clinet 5065 plz and ineed acc server 5065 pales mans elitepvpers plz Source clinet 5065 Now:handsdown::handsdown::handsdown:
The last helps!!! small helps :D
01/26/2009 - CO2 Private Server - 2 Replies
I did a server with PowerCoSource .... i need some helps codes and.... Or tell me the best source to use 1. DisCity didn't work 2. LuckyTime didn't work 3. Reborn is not good ... i need good codes for RB 4. When i add npc and i edit all things it appear in conquer but didn't work 5. Offline TG too 6. i want good broadcast ----------------------> I am working in the client that it have CIDloader ----------------------> I want more ppl :D :D :D after i finish it ....
PLZ HELP ME PLZ PLZ PLZ!!!!!!!!!&#
06/21/2007 - Conquer Online 2 - 3 Replies
hi guys.. am a new user in this fourm and i wished u can help me how can i open a soket.. not only in wepons... in all stuff "boots.neckls.. rings. earings.coat...." in an easy way ... i need the way very quikly plzzzzzzzzzzz and plz tell me the times when i can do this... and how can i transfrom dbs from server to another,.... :cry: :cry: :cry: plz plz plz help me ..... plz answer me very very very quickly thx so much..



All times are GMT +1. The time now is 20:22.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.