php script

Results 1 to 8 of 8
  1. #1
    Account Upgraded | Title Enabled! 00niels00 is offline
    MemberRank
    Sep 2008 Join Date
    The NetherlandsLocation
    1,041Posts

    php script

    Hello, Because my server is completed today.
    I want a welcome script.
    In php. I want that they can enter their charater name. And if they press send.
    That they will get item id "50042".
    Do any one know a script to do this?


  2. #2
    Status: Pooping eele is offline
    MemberRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    Re: php script

    Just edit the thing from Emisands Admin panel:) i did it for my donation system :P

  3. #3
    Account Upgraded | Title Enabled! 00niels00 is offline
    MemberRank
    Sep 2008 Join Date
    The NetherlandsLocation
    1,041Posts

    Re: php script

    but how? How to set standard send item to 50042?
    How to delete login?
    Can some on send a "senditem" script
    Or a donation script that i can edit?

  4. #4
    RestyleGamerZ FTW Mambo is offline
    MemberRank
    Mar 2008 Join Date
    The NetherlandsLocation
    821Posts

    Re: php script

    Somethign like:
    <?php
    $Host="YOURNAME\SQLEXPRESS";
    $Name="sa";
    $Pass="YOURPASS";
    $Db="GunzDB";
    MSSQL_Connect ("$Host,$Name,$Pass");
    MSSQL_Select_db ("GunzDB")
    ?>
    <?php
    FORM HERE.. i didn't work with html for long time so idk
    ?>
    <?php
    INSERT IN CharItem ("ITEMID") WHERE Charname = ['$_Post']
    ?>


    This is a part/start of a script :P someone with more knowlegde can finish this.. btw don't flame me if it sux cause it's my first thing ever :P

  5. #5
    Account Upgraded | Title Enabled! 00niels00 is offline
    MemberRank
    Sep 2008 Join Date
    The NetherlandsLocation
    1,041Posts

    Re: php script

    It's basic can some one give a better script or fill up the script.
    I want a form with character name and a submit button. Got any one a script like that?

  6. #6
    Status: Pooping eele is offline
    MemberRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    Re: php script

    omfgz. lol u can use the Form, from emisands panel and the if asset :P from the characters.php :P easy to do.. ^^

  7. #7
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: php script

    Quote Originally Posted by Mambo View Post
    Somethign like:
    <?php
    $Host="YOURNAME\SQLEXPRESS";
    $Name="sa";
    $Pass="YOURPASS";
    $Db="GunzDB";
    MSSQL_Connect ("$Host,$Name,$Pass");
    MSSQL_Select_db ("GunzDB")
    ?>
    <?php
    FORM HERE.. i didn't work with html for long time so idk
    ?>
    <?php
    INSERT IN CharItem ("ITEMID") WHERE Charname = ['$_Post']
    ?>


    This is a part/start of a script :P someone with more knowlegde can finish this.. btw don't flame me if it sux cause it's my first thing ever :P
    Roflmao. INSERT IN... LOL.

    This comes straight out of my head, it's weekend and 10:35 PM so I might make a few typing mistakes:

    PHP Code:
    <?php
    //Made by Wizkid.
    //Removing my copyright is stupid.
        
    //Let us connect the database.
    $host "";
    $username "";
    $password "";
    $database "GunzDB";

    mssql_connect($host$username$password) or die("Can't connect the db server.");
    mssql_select_db($database) or die("Can't select the database.");

    //Anti SQL injection
    function antisql($sql)
    {
    // Remove words that contain SQL syntax
    $sql preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
    $sql trim($sql); //Cleans up spaces
    $sql strip_tags($sql);//Php and html tags strip
    $sql addslashes($sql);//Adds backslashes to one string
    return $sql;
    }

    //GET the act and do the stuff.
    if (isset($_GET['act']) AND $_GET['act'] == "do")
    {
    //Let's get the charname.
    $charname antisql($_POST['charname']);

    //No charname entered... the bastard.
    if (empty($charname))
    {
        die(
    "No shit.");
    }

    //Let us get the CID.
    $query mssql_query("SELECT CID FROM Character WHERE Name = '$charname'");
    $count mssql_num_rows($query);

    //Charname doesn't exist into the table or does exist multiple times.
    if ($count != 0)
    {
        die(
    "Shit happened or you can't type.");
    }

    $res mssql_fetch_assoc($query);

    //The real part. Edit the ItemID eventually.
    mssql_query("INSERT INTO CharacterItem (CID, ItemID) VALUES ('$res[CID]', '50042')");

    }
    ?>
    <form action='<?=$_SERVER['PHP_SELF']?>?act=do' method='POST'>
    Text shit goes here.<br><br>
    <table width='250'>
    <tr>
    <td width='50%'><b>Charactername:</b></td>
    <td width='50%'><input type='text' name='charname'></td>
    </tr>
    <tr>
    <td width='50%'></td>
    <td width='50%'><input type='submit' value='Welcome!'></td>
    </tr>
    </table>
    </form>
    <br><br>
    <font size='1'>Made by Wizkid.</font>

  8. #8
    Account Upgraded | Title Enabled! 00niels00 is offline
    MemberRank
    Sep 2008 Join Date
    The NetherlandsLocation
    1,041Posts

    Re: php script

    I get apache error.

    lol
    die("Shit happened or you can't type.");
    die("No shit.");
    //No charname entered... the bastard.
    <font size='1'>Made by Wizkid the best!.</font> (de harde waarheid)



Advertisement