Set GM and View GM

Results 1 to 9 of 9
  1. #1
    Banned aldieri is offline
    BannedRank
    Oct 2008 Join Date
    ArizonaLocation
    250Posts

    Set GM and View GM

    Set GM and View GM php script.
    Spoiler:

    <?php
    function Connect() {
    mssql_connect('Server','USERNAME','USERPW') or die('Error: Connection to DB

    Failed.');
    }

    function InitForm(){
    //layout for the form
    echo "<strong>Character Auth</strong><br>
    <form name='character' method='post'>
    <lable>Character Name</lable><br/>
    <input type='text' name='character_name'/><br/>
    <lable>Auth Level</lable><br/>
    <input type='text' name='auth'/><br/>
    <input type='submit'/>
    </form>
    <br><br>
    <strong>Select Character Auth</strong>
    <form name='select' method='post'>
    <lable>Character Name</lable><br/>
    <input type='text' name='char2'/><br/>
    <input type='submit'/>
    </form>";
    }

    function PostListener (){
    //Add more post variables if needed and add them to initform() function aswell

    ################################
    ##### Connection and Post ######
    ################################
    $init = Connect(); //will work once you put the right information
    $char = @$_POST['character_name'];
    $auth = @$_POST['auth'];
    $name = @$_POST['char'];
    $name2 = @$_POST['char2'];
    ################################

    //Check both variables for empty value
    if (!empty($_POST['character_name']) && !empty($_POST['auth'])){
    //Perform Query
    $query = mssql_query("update [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] set m_chAuthority

    = '{$auth}' where m_szName = '{$char}'");
    echo "{$char} is Now Authority '{$auth}'";
    }

    if (!empty($_POST['char2'])){
    $Auth = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where

    m_szName = '{$name2}'");
    while ($row = mssql_fetch_object($Auth)){
    echo "{$name2} Is Currently Authority '$row->m_chAuthority'";
    }

    }

    }

    $InitForm = InitForm();
    $Listener = PostListener();

    ?>


    You can enter a username and an authority level on the first part, and on the second form you can just enter a username to view their current authority.



    Thanks to Deformed for a lot of help :)
    Last edited by aldieri; 18-06-10 at 06:16 AM.


  2. #2
    Banned VLxPain is offline
    BannedRank
    May 2010 Join Date
    121Posts

    Re: Set GM and View GM

    bettur then having 50 scripts(apixen)
    gut job sir

  3. #3
    0xC0FFEE spikensbror is offline
    MemberRank
    Dec 2006 Join Date
    SwedenLocation
    1,855Posts

    Re: Set GM and View GM

    Wow, no thank me? Q.Q
    I helped you with this as well.
    Anyways. ;D
    Awesome release, though you might want to put in a SqlFilter function of some sort so SQL injection isn't possible.

  4. #4
    Banned aldieri is offline
    BannedRank
    Oct 2008 Join Date
    ArizonaLocation
    250Posts

    Re: Set GM and View GM

    Quote Originally Posted by spikensbror View Post
    Wow, no thank me? Q.Q
    I helped you with this as well.
    Anyways. ;D
    Awesome release, though you might want to put in a SqlFilter function of some sort so SQL injection isn't possible.
    This one doesn't have your help in it ;) Its another script that does <: But yeah, Haven't bothered tossing anti-sql injection into it yet since its just been used locally for me, and focusing on finishing everything first ;) But yea you and Deformed are ma lil php teachers <3

    Actaully, nvm, my version of this script does have your help in it <3. Just theres no need to release this with a config file/functions file...
    Last edited by aldieri; 18-06-10 at 02:21 PM.

  5. #5
    Infraction Banned BGxApixen is offline
    MemberRank
    May 2009 Join Date
    939Posts

    Re: Set GM and View GM

    Not bad, mind if I put it in my compile thread?
    Ima change it to "Compile of all releases"

  6. #6
    Banned aldieri is offline
    BannedRank
    Oct 2008 Join Date
    ArizonaLocation
    250Posts

    Re: Set GM and View GM

    Quote Originally Posted by apixen View Post
    Not bad, mind if I put it in my compile thread?
    Ima change it to "Compile of all releases"
    Sure.

  7. #7
    Account Upgraded | Title Enabled! Nick1337 is offline
    MemberRank
    May 2009 Join Date
    357Posts

    Re: Set GM and View GM

    Very nice , but i have few questions.
    What is the "empty" code does and what the "{" "}" for? you can just use the variable with '.$var.'

  8. #8
    Banned aldieri is offline
    BannedRank
    Oct 2008 Join Date
    ArizonaLocation
    250Posts

    Re: Set GM and View GM

    Quote Originally Posted by Nick1337 View Post
    Very nice , but i have few questions.
    What is the "empty" code does and what the "{" "}" for? you can just use the variable with '.$var.'
    Like I said deformed helped out a lot, and hes a nerd and likes to do the {" "} instead of single quotes............ (He explained this one.)

    And the empty if its not empty it uses the query.

  9. #9
    Dragona wishly is offline
    MemberRank
    Aug 2008 Join Date
    PhilippinesLocation
    296Posts

    Re: Set GM and View GM

    thanks for releasing this.



Advertisement