Jump to content
  • 0

[REQUEST]SCRIPT


Question

Posted

 

Here is the script for http://2pay.pro/!But for some reason it does not wanna work!

Can somebody look at this code,and see if something is wrong!

It is not coded by me,i found it on some forum!

If somebody could get this working it would really help many users of this forum to have good donation system!

As they have over 60 payment options!

----------------------------------------------------------------------------------------------------------------------------

<?php

 

//

//

 

 

header( 'Content-type: text/xml' );

//Ип адреса, с которых будет приходить запрос. Для защиты.

$check_ip[]="82.146.40.60";

$check_ip[]="188.120.245.101";

$check_ip[]="188.120.245.102";

    $date=date("d.m.y");

//======================================настройки============================================

// Секретный ключ

$secret_key = "your-secret-key";

// Переменные для подключения к базе данных, впишите те, которые использовали при установке базы данных

$server='localhost';

$user='user';

$pass='password';

$db='l2jdb';

//===========================================================================================

    $flag = $_REQUEST['command'];

    $md5 = $_REQUEST['md5'];

 

// Идентификатор платежа

$v1 = $_REQUEST['v1'];

 

 

if( isset($_REQUEST['id']) ) $id=$_REQUEST['id']; else $id=0;

$kod=1;

 

// Проверка ип

if (in_array($_SERVER['REMOTE_ADDR'], $check_ip)) {

 

// Подключение к базе данных

mysql_connect($server, $user, $pass) or die("Can't connect to database");

mysql_select_db($db) or die("Can't select database ".$db);

 

// Если статус запрос

if( ($flag == 'check') && ($md5 == md5($flag.$v1.$secret_key)) ) {

// Поиск персонажа

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$rows = mysql_num_rows($sql);

if ($rows > 0) {

$kod=0;

$desc='Character exists';

} else {

$kod=1;

$desc='Character not found';

}

} else {

  // Если команда на платеж

if( ($flag == 'pay') && ($md5 == md5($flag.$v1.$id.$secret_key)) )  {

 

$sql=mysql_query("SELECT * FROM `2pay_payment` WHERE `id`='".$id."'");

$rows = mysql_num_rows($sql);

                // Если платеж был проведен ранее

if ($rows > 0)

{

$kod=0;

$desc='Payment was send earlier';

} else

{  // Иначе пытаемся провести платеж

 

$item_count=$_REQUEST['sum']; // Количество монет для зачисления, полученное в запросе

 

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$character=mysql_fetch_array($sql);

$account_ref=$character['account_name'];

 

                    // Если персонаж найден

if(mysql_num_rows($sql)==1) {

// Добавляем персонажу количество купленных монет

$sql=mysql_query("INSERT INTO `your_table` (`owner_id`,`item_id`,`count`,`enchant_level`,`flags`,`payment_status`, `description`) VALUES ('".$character['obj_Id']."','".$item."','".$item_count."','0','0','0', '2pay date ".$date." ".$v1."')") or die(mysql_error());

// Указываем таблицу для даты, суммы, и айди платежа ее я залил вместе со скриптом

$sql=mysql_query("INSERT INTO `2pay_payment` (`count`,`date`,`id`) VALUES ('".$_REQUEST['sum']."','".$date."','".$_REQUEST['id']."')");

 

 

$kod=0;

    $desc="ok";

} else

{

$kod=2;

    $desc="Character not found";

}

}

} else

{  // // Обработка исключения: если не совпал md5 или неизвестный запрос

$kod=2;

$desc="Unknown request or account not found";

}

}

} else { $desc="Parametrs or IP is not correct"; }

// Ответ

    if ($flag == 'status') {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><result>".$kod."</result></response>"; } else

    {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><id>".$id."</id><sum>".$_REQUEST['sum']."</sum><result>".$kod."</result><comment>".$desc."</comment></response>"; }

echo $html;

?>

5 answers to this question

Recommended Posts

  • 0
Posted

<?php

 

//

//

 

 

header( 'Content-type: text/xml' );

//IP ADDRESS WHICH WILL SEND REQUEST.FOR SECURITY REASON

$check_ip[]="82.146.40.60";

$check_ip[]="188.120.245.101";

$check_ip[]="188.120.245.102";

    $date=date("d.m.y");

//======================================SETUP============================================

// SECRET KEY

$secret_key = "&f:GI1+v0[|IX%Y?#L.DXg+|i]?N!zXe";

// MYSQL DETAILS

$server='localhost';

$user='user';

$pass='password';

$db='l2jdb';

//===========================================================================================

    $flag = $_REQUEST['command'];

    $md5 = $_REQUEST['md5'];

 

// PAYMENT IDENTICIFATION KEY

$v1 = $_REQUEST['v1'];

 

 

if( isset($_REQUEST['id']) ) $id=$_REQUEST['id']; else $id=0;

$kod=1;

 

// IP CHEK

if (in_array($_SERVER['REMOTE_ADDR'], $check_ip)) {

 

// CONNECTING TO DATABASE

mysql_connect($server, $user, $pass) or die("Can't connect to database");

mysql_select_db($db) or die("Can't select database ".$db);

 

// IF REQUEST STATUS

if( ($flag == 'check') && ($md5 == md5($flag.$v1.$secret_key)) ) {

// FINDING CHARACTER

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$rows = mysql_num_rows($sql);

if ($rows > 0) {

$kod=0;

$desc='Character exists';

} else {

$kod=1;

$desc='Character not found';

}

} else {

  // If command for payment

if( ($flag == 'pay') && ($md5 == md5($flag.$v1.$id.$secret_key)) )  {

 

$sql=mysql_query("SELECT * FROM `2pay_payment` WHERE `id`='".$id."'");

$rows = mysql_num_rows($sql);

                // If payment was made before

if ($rows > 0)

{

$kod=0;

$desc='Payment was send earlier';

} else

{  // Trying to make payemnt

 

$item_count=$_REQUEST['sum']; // Ammount of rewards

 

$sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");

$character=mysql_fetch_array($sql);

$account_ref=$character['account_name'];

 

                    // IF CHARACTER NOT FOUND

if(mysql_num_rows($sql)==1) {

// SENDING REWARD TO CHARACTER

$sql=mysql_query("INSERT INTO `your_table` (`owner_id`,`item_id`,`count`,`enchant_level`,`flags`,`payment_status`, `description`) VALUES ('".$character['obj_Id']."','".$item."','".$item_count."','0','0','0', '2pay date ".$date." ".$v1."')") or die(mysql_error());

// TABLE TO SHOW DATE/TIME/SUM of payment

$sql=mysql_query("INSERT INTO `2pay_payment` (`count`,`date`,`id`) VALUES ('".$_REQUEST['sum']."','".$date."','".$_REQUEST['id']."')");

 

 

$kod=0;

    $desc="ok";

} else

{

$kod=2;

    $desc="Character not found";

}

}

} else

{  // // Exception,if MD5 is wrong or wrong request was sent

$kod=2;

$desc="Unknown request or account not found";

}

}

} else { $desc="Parametrs or IP is not correct"; }

// Ответ

    if ($flag == 'status') {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><result>".$kod."</result></response>"; } else

    {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><id>".$id."</id><sum>".$_REQUEST['sum']."</sum><result>".$kod."</result><comment>".$desc."</comment></response>"; }

echo $html;

?>

 

----------------------------------------------------------------------------------------------------------------

Here it is with english comments!

This is automatic payment script,using system 2pay.pro!

Players pay money and get rewards!

But for some reason i can not get it to work!

It is really good payment system!

  • 0
Posted
<?php

// 
// 


   header( 'Content-type: text/xml' );
//IP ADDRESS WHICH WILL SEND REQUEST.FOR SECURITY REASON
   $check_ip[]="82.146.40.60";
   $check_ip[]="188.120.245.101";
   $check_ip[]="188.120.245.102";
    $date=date("d.m.y");
//======================================SETUP============================================
// SECRET KEY
   $secret_key = "&f:GI1+v0[|IX%Y?#L.DXg+|i]?N!zXe";
// MYSQL DETAILS
   $server='localhost';
   $user='user';
   $pass='password';
   $db='l2jdb';
//===========================================================================================
    $flag = $_REQUEST['command'];
    $md5 = $_REQUEST['md5'];

// PAYMENT IDENTICIFATION KEY
   $v1 = $_REQUEST['v1'];


   if( isset($_REQUEST['id']) ) $id=$_REQUEST['id']; else $id=0;
   $kod=1;

// IP CHEK
   if (in_array($_SERVER['REMOTE_ADDR'], $check_ip)) {

// CONNECTING TO DATABASE
   mysql_connect($server, $user, $pass) or die("Can't connect to database");
   mysql_select_db($db) or die("Can't select database ".$db);

      // IF REQUEST STATUS
      if( ($flag == 'check') && ($md5 == md5($flag.$v1.$secret_key)) ) {
         // FINDING CHARACTER
         $sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");
         $rows = mysql_num_rows($sql);
         if ($rows > 0) {
            $kod=0;
            $desc='Character exists';
         } else {
            $kod=1;
            $desc='Character not found';
         }
      } else {
         // If command for payment
         if( ($flag == 'pay') && ($md5 == md5($flag.$v1.$id.$secret_key)) )  {

            $sql=mysql_query("SELECT * FROM `2pay_payment` WHERE `id`='".$id."'");
            $rows = mysql_num_rows($sql);
                // If payment was made before
            if ($rows > 0)
            {
               $kod=0;
               $desc='Payment was send earlier';
            } else
            {   // Trying to make payemnt

               $item_count=$_REQUEST['sum']; // Ammount of rewards

               $sql=mysql_query("SELECT * FROM `account` WHERE `username`='".$v1."' LIMIT 0, 1");
               $character=mysql_fetch_array($sql);
               $account_ref=$character['account_name'];

                    // IF CHARACTER NOT FOUND
               if(mysql_num_rows($sql)==1) {
               // SENDING REWARD TO CHARACTER
                  $sql=mysql_query("INSERT INTO `your_table` (`owner_id`,`item_id`,`count`,`enchant_level`,`flags`,`payment_status`, `description`) VALUES ('".$character['obj_Id']."','".$item."','".$item_count."','0','0','0', '2pay date ".$date." ".$v1."')") or die(mysql_error());
               // TABLE TO SHOW DATE/TIME/SUM of payment
                  $sql=mysql_query("INSERT INTO `2pay_payment` (`count`,`date`,`id`) VALUES ('".$_REQUEST['sum']."','".$date."','".$_REQUEST['id']."')");


                  $kod=0;
                   $desc="ok";
               } else
               {
                  $kod=2;
                   $desc="Character not found";
               }
            }
         } else
         {   // // Exception,if MD5 is wrong or wrong request was sent
            $kod=2;
            $desc="Unknown request or account not found";
         }
      }
   } else {      $desc="Parametrs or IP is not correct";   }
// Ответ
    if ($flag == 'status') {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><result>".$kod."</result></response>"; } else
    {$html="<?xml version=\"1.0\" encoding=\"windows-1251\"?><response><id>".$id."</id><sum>".$_REQUEST['sum']."</sum><result>".$kod."</result><comment>".$desc."</comment></response>"; }
   echo $html;
?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.



  • Posts

    • hey bro i know this post its old, buy any can help me with the InertiaPath?  
    • Can you post your olympiad config?
    • Advanced Lineage II Event Engine – Flexible, Scalable, and Developer-Friendly Introducing a powerful and fully customizable event engine designed to enhance gameplay, increase player engagement, and simplify event management. Whether you're running a high-rate PvP server or a low-rate retail-like experience, this engine provides the flexibility you need to create and automate dynamic in-game events.   ✅ Compatible with aCis 401 – Fully coded for aCis project (revision 401) and ready for seamless integration. 📜 Delivered as a .diff Patch – Simply apply it and start using it right away!   📸 Check out the screenshots & features: Imgur Album (more soon). Key Features ✔ Fully Configurable – Every aspect of each event can be customized, including timers, rules, rewards, and restrictions. ✔ Seamless Integration – Works with existing server configurations and supports custom scripts or modifications. ✔ Automated Event Rotation – Events can be scheduled or started via a voting phase where players choose the next event. ✔ Multi-Mode Participation – Players can join via commands (.register | .leave | .events) or NPC interactions. ✔ Real-Time Tracking – An on-screen HUD displays kills, scores, and time remaining. ✔ Enhanced PvP Mechanics – Auto-respawn, score-based rewards, and First Blood announcements. ✔ Spectator Mode – Allows non-participants to watch events live. ✔ Detailed Event Logs – Administrators can track player performance, winners, and event results for analysis. Reward System Player-Based Rewards: Configurable options for winning, losing, ranking in the top X, or achieving First Blood. Kill-Based Rewards: Earn rewards per kill or based on streaks. Team-Based Rewards: Incentivize team victories with shared prizes. Included Event Modes Team Fights (TDM): Classic team-based PvP with configurable duration, respawn rules, and score limits. Solo Fights (Deathmatch): Free-for-all PvP—highest kill count wins. Last Survivor (LMS): No respawns—last player standing wins. Lucky Chests: Random chests with rewards, traps, or debuffs. Treasure Hunt: Players race to find a hidden treasure. Monster Massacre (PvE Race): Teams compete to slay the most monsters. Territory Clash: Players battle to control a zone and earn points over time. Ultra Rapid Fire (URF Mode): Boosted stats, reduced skill cooldowns, and enhanced combat speed. Assassin Hunt: A random player is marked as the target—others must eliminate them. Monster Mayhem (Boss Raid): A powerful boss spawns; players must cooperate (or fight each other) to take it down. Power-Up Clash: Players collect battlefield buffs for a combat advantage. Why Choose This Event Engine? ✅ Fast Implementation – Set up new events in minutes with an intuitive configuration system. ✅ Performance Optimized – Lightweight and designed for high player counts without impacting server stability. ✅ Extensive Customization – Easily modify or extend functionality to suit your server’s needs. ✅ Developer Support – Well-documented API and configuration options for easy integration. Transform your server’s event experience with a feature-rich, developer-friendly solution. 🚀 Ready to integrate? Contact us for licensing details! Get Your Copy Today! Upgrade your Lineage II server with this powerful event engine and bring next-level gameplay to your players. With fully customizable settings, automated event management, and seamless integration, this system is a must-have for any serious server administrator.   💰 Pricing: Full License: 100e (One-time payment) Support & Updates: included on full licence   📩 How to Purchase: PM me directly for inquiries and purchases. Discord: @Luminous
    • we sell website templates, make websites to order. Great selection at very good prices. My contacts   discord - adver745645   telegram - @mmopromo
  • Topics

×
×
  • Create New...