PHP Send Coin Script

Results 1 to 3 of 3
  1. #1
    Member xgosu is offline
    MemberRank
    Dec 2009 Join Date
    61Posts

    PHP Send Coin Script

    Hello there guys.
    I'm wondering id anyone could help me to make a PHP script to send coin to certain user? Im not asking for spoonfeed just some head start.


  2. #2
    Account Upgraded | Title Enabled! alfredao is offline
    MemberRank
    Jan 2008 Join Date
    Coronel FabriciLocation
    705Posts

    Re: PHP Send Coin Script

    PHP Code:
    <?php

    if(isset($_POST['changecoins']))
    {
        
    $type $_POST['type'];
        
    $id $_POST['id'];
        
    $coins $_POST['coins'];

        if( 
    $type == )
        {
            
    $query02 mssql_query("SELECT AID FROM Login(nolock) WHERE UserID = '$id'");
            
    $part "UserID";
        }
        elseif( 
    $type == )
        {
            
    $query02 mssql_query("SELECT UserID FROM Login(nolock) WHERE AID = '$id'");
            
    $part "AID";
        }
        else
        {
            die();
        }

        if( 
    mssql_num_rows($query02) != )
        {
            die(
    "Account doesn't exists");
        }
        else
        {
            
    mssql_query("UPDATE Login SET Coins = Coins + $coins WHERE $part = '$id'");
            die(
    "Coins added succesfully");
        }
    }

    ?>

    <h3>Add Coins</h3>
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <select name="type">
        <option value="0">UserID</option>
        <option value="1">AID</option>
    </select>&nbsp;&nbsp;
    <input type="text" name="id" />&nbsp;&nbsp;Coins:&nbsp;&nbsp;
    <input type="text" name="coins" />&nbsp;&nbsp;
    <input type="submit" name="changeccoins" value="Add Coins" />
    </form>

  3. #3
    Ā  Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts
    Quote Originally Posted by alfredao View Post
    PHP Code:
    <?php

    if(isset($_POST['changecoins']))
    {
        
    $type $_POST['type'];
        
    $id $_POST['id'];
        
    $coins $_POST['coins'];

        if( 
    $type == )
        {
            
    $query02 mssql_query("SELECT AID FROM Login(nolock) WHERE UserID = '$id'");
            
    $part "UserID";
        }
        elseif( 
    $type == )
        {
            
    $query02 mssql_query("SELECT UserID FROM Login(nolock) WHERE AID = '$id'");
            
    $part "AID";
        }
        else
        {
            die();
        }

        if( 
    mssql_num_rows($query02) != )
        {
            die(
    "Account doesn't exists");
        }
        else
        {
            
    mssql_query("UPDATE Login SET Coins = Coins + $coins WHERE $part = '$id'");
            die(
    "Coins added succesfully");
        }
    }

    ?>

    <h3>Add Coins</h3>
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <select name="type">
        <option value="0">UserID</option>
        <option value="1">AID</option>
    </select>&nbsp;&nbsp;
    <input type="text" name="id" />&nbsp;&nbsp;Coins:&nbsp;&nbsp;
    <input type="text" name="coins" />&nbsp;&nbsp;
    <input type="submit" name="changeccoins" value="Add Coins" />
    </form>
    Thanks a lot man!
    Posted via Mobile Device



Advertisement