Thread: [TUT] Daopay integration

Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1 [TUT] Daopay integration V2 EDIT! 
    Registered Member thoompie's Avatar
    Join Date
    Feb 2007
    Age
    30
    Posts
    115
    Thanks given
    0
    Thanks received
    0
    Rep Power
    34
    Purpose: Adding Daopay PIN check tool to your website

    Difficulty: 3

    Assumed Knowledge: SQL info, Some PHP, HTML, common sense.

    Server Base: Any server that you have integrated with your IBF

    Classes Modified:
    validate.php form.html

    EDIT ** Admins can soon use their password as pin to give someone free premium membership! And i integrated anti double pin usage, and password requirement.



    Step 1:
    First of all, register at [Only registered and activated users can see links. ] and Enter your website, and create the product you want to sell on your website. (in this case premium)

    Then the database part for the pins:

    Create a table named "Pins" in your servers database.
    Inside the table there will be a few fields:
    - ID (int 4 auto increment not null)
    - PIN (varchar 20 not null)
    - DATE (date not null)

    Heres the SQL query:
    Code:
    /*
    MySQL Data Transfer
    Source Host: localhost
    Source Database: runescape
    Target Host: localhost
    Target Database: runescape
    Date: 6/6/2008 11:22:38 AM
    */
    
    SET FOREIGN_KEY_CHECKS=0;
    -- ----------------------------
    -- Table structure for pins
    -- ----------------------------
    CREATE TABLE `pins` (
      `ID` int(4) NOT NULL,
      `PIN` varchar(20) NOT NULL,
      `DATE` date NOT NULL,
      PRIMARY KEY  (`ID`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    -- ----------------------------
    -- Records 
    -- ----------------------------



    Step 2
    When you have created your account and executed the query, it's time to create the PHP file.
    Create a PHP file called validate.php and put this code in it:

    Code:
    <?php
    //////////////////////////////////////////////////////////////////////////
    // Including Daopay service in your Forums.		         //
    // Made by Krijn Faber (Thoompie) of www.nomercygame.org©  //
    // V2.0 features:					         //
    // - Support for Invision power-board		                     //
    // - Anti SQL injecting, and Anti HTML usage                         //
    // - Anti double pin Usage (Used pins are stored in a database //
    // - Password requirement                                                 //
    // - Soon admins can use their password as pin, to make        //
    //    Other people member.                                                //
    // ------------------------------------------------------     //
    /////////////////////////////////////////////////////////////////////////
    
    // Start of script
    $name = $_POST["name"]; // Recieve POST entries from form.html
    $name = mysql_real_escape_string($name); // Anti SQL Injecting
    $name = htmlentities($name); // Anti HTML code
    
    $pin = $_POST["pin"]; // Recieve POST entries from form.html
    $pin = mysql_real_escape_string($pin); // Anti SQL Injecting
    $pin = htmlentities($pin); // Anti HTML code
    
    $pass = $_POST["pass"]; // Recieve POST entries from form.html
    $pass = mysql_real_escape_string($pass); // Anti SQL Injecting
    $pass = htmlentities($pass); // Anti HTML code
    
    $handle = fopen("http://DaoPay.com/svc/PINcheck?appcode=44919&subkey=1&pin=".$pin, "r"); // Forcing Pin validity check [ Edit parameters]
    if ($handle) {
    $reply = fgets($handle);
    if (substr($reply,0,2) == "ok") { // Check for reply "OK"
    $con = mysql_connect("SQL HOST","SQL USER","SQL PASS"); // Connect to the database [ Edit the parameters]
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("SQL DATABASE", $con); // Selecting the Database
    $passq = mysql_query("SELECT * FROM ibf_members WHERE name = '$name' AND password = 'md5($pass)' ");
    $checkpw = mysql_num_rows($passq);
    
    $checkpin = mysql_query("SELECT * FROM 'Pins' WHERE 'PIN' = $pin");
    $pinrows = mysql_num_rows($checkpin);
    
    if ($passq > 0  && $pinrows == 0) {
    
    mysql_query("UPDATE ibf_members SET mgroup = '7' WHERE name = '$name' AND mgroup = '3'");
    mysql_query("INSERT INTO 'Pins' VALUES ($pin)");
    // For Invision Power-Board, Edit for other forums, V3 of this script will include vBulletin, phpBB and Invision power-Board
    mysql_close($con);
    echo "You are now a premium member." ; // Echoing the success :)
    			
    }
    }
    }
    // Copyright Krijn Faber ©
    ?>
    There are a few parameters you have to edit:

    - appcode= (replace 44919 with your appcode, wich you can find on daopay.com when logged in.)

    -subkey= (your product id, the name of your product, also look on daopay.com)

    -SQL HOST (Fill out your host IP here, if running on your own PC its: "localhost")

    -SQL USER (SQL server root user, or other user with full access)

    -SQL PASS (Password you have set for the user aforementioned.)

    -SQL DATABASE (The database of your IBF)

    After you edited all these parameters, save and close.
    Upload validate.php to your webserver.

    Step 3
    To send the required info to the pin check you will have to use the following form:

    Code:
    <html>
    <head><title> Membership validating form </title></head>
    <body>
    <center><b> Use the form below to activate your pincode, and enjoy premium on your account.</b><br><br>
    <form action="validate.php" method="post">
    Enter your username: <input type="text" name="name" />
    Enter your password <input type="password" name="pass" />
    Enter your pincode: <input type="text" name="pin" />
    <input type="submit" />
    </form>
    <br>
    <b> Or click <a href="https://daopay.com/svc/pay.svc?tidkey=44919&subkey=1&postrequest=true">here</a> to buy a pin.<br>
    </center>
    </body>
    </html>
    - You might have to edit the validate.php if its not in the same directory as form.html

    - Again edit the appcode and subkey for daopay.

    Save, close, Upload or integrate on portal.

    *Notice When putting it on portal, you only have to use the html code from <center> till </center>.

    Finished.

    Credits 100% Me
    Rep ++ would be nice if you use it!
    Please dont remove my copyright.
     

  2. #2  
    Mr.Smooth
    Guest
    and why would this be any good for rs server ?
     

  3. #3  
    Registered Member
    wh1p's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    1,983
    Thanks given
    26
    Thanks received
    285
    Rep Power
    320
    Quote Originally Posted by Mr.Smooth View Post
    and why would this be any good for rs server ?
    Ya I don't get this..
     

  4. #4  
    Member
    Boomer's Avatar
    Join Date
    Sep 2006
    Posts
    1,282
    Thanks given
    309
    Thanks received
    795
    Rep Power
    1111
    Maybe to make the players buy an account.. IDK


    [Only registered and activated users can see links. ] ||| FightScape | InnerFantasy | PkIsle | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ]
     

  5. #5  
    Registered Member
    wh1p's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    1,983
    Thanks given
    26
    Thanks received
    285
    Rep Power
    320
    Quote Originally Posted by Boomer View Post
    Maybe to make the players buy an account.. IDK
    Oo That would be awesome tbh
     

  6. #6  
    Registered Member
    BamBam's Avatar
    Join Date
    Jan 2007
    Posts
    270
    Thanks given
    24
    Thanks received
    8
    Rep Power
    153
    Looks useful, but I don't see how it validates that a pin has already been used, could people just use the same pin over and over again?

    Runekeep®
     

  7. #7  
    Registered Member thoompie's Avatar
    Join Date
    Feb 2007
    Age
    30
    Posts
    115
    Thanks given
    0
    Thanks received
    0
    Rep Power
    34
    Log in on daopay.com and set the pin validity settings.
    This is for validating the pin code, and auto makes the player premium after entering the pin.
     

  8. #8  
    Mr.Smooth
    Guest
    ooh thats nice,maybe i will use this in the future
     

  9. #9  
    Registered Member


    Join Date
    Jul 2007
    Posts
    4,133
    Thanks given
    789
    Thanks received
    2,716
    Rep Power
    5000
    nice but you should add some little modifications if possible for now heres you rep
     

  10. #10  
    mrdek11
    Guest
    Isn't this asking for problems from Jagex? I really like the idea, but it seems like Jagex's dormant position against private servers will change if we begin to make money off them. (Other than donations I mean.)
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •