[Release][PHP] GM App, GM Contact, Logout!

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Member AlmarM is offline
    MemberRank
    Apr 2008 Join Date
    79Posts

    [Release][PHP] GM App, GM Contact, Logout!

    Hello,

    I tought this would be usefull:

    GM Application (gmapps.php)
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <
    HTML>
    <
    HEAD>
        <
    META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
        <
    TITLE>GM Application</TITLE>
        <
    STYLE TYPE="text/css">
        </
    STYLE>
    </
    HEAD>
    <
    BODY LANG="nl-NL" DIR="LTR">
    <
    P ALIGN=CENTER><BR><BR><BR><BR>
    </
    P>
    <
    H1 ALIGN=CENTER>GM Application</H1>
    <
    FORM ACTION="send_gmapp.php" METHOD="POST">
        <
    CENTER>
            <
    TABLE BORDER=1 CELLPADDING=5 CELLSPACING=1 FRAME=VOID RULES=GROUPS>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Name:</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="name" SIZE=20 MAXLENGTH=30 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Age:</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="age" SIZE=20 MAXLENGTH=2 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Account Name:</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="accountname" SIZE=20 MAXLENGTH=30 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Experience:</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="experience" SIZE=20 MAXLENGTH=100 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Why sould you be GM:</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="why" SIZE=20 MAXLENGTH=70 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=4 BGCOLOR="#425984">
                        <
    P><FONT COLOR="#eeeeee"><INPUT TYPE=SUBMIT NAME="send_app" VALUE="Send Application!"</FONT>
                        </
    P>
                    </
    TD>
                </
    TR>
            </
    TABLE>
        </
    CENTER>
    </
    FORM>
    <
    P ALIGN=CENTER><BR><BR>
    </
    P>
    </
    BODY>
    </
    HTML
    GM Application (send_gmapps.php)
    PHP Code:
    <?php
    $host
    ['name'] = 'localhost'//Host (IP)
    $host['username'] = 'root'//Username
    $host['password'] = ''//Password
    $host['databasename'] = 'odinms'//DB

    $db mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to MySQL!');
    mysql_select_db($host['databasename'], $db);

    $name $_POST['name'];
    $age $_POST['age'];
    $accountname $_POST['accountname'];
    $experience $_POST['experience'];
    $why $_POST['why'];

    $sel "SELECT * FROM accounts WHERE name='$name'";
    $d "INSERT INTO gmapps (name, age, accountname, experience, why) VALUES ('$name', '$age', '$accountname', '$experience', '$why')";
    mysql_query($d) OR die (mysql_error());
    echo 
    "Your GM Application has been send!";
    ?>
    MySQL Command
    Code:
    DROP TABLE IF EXISTS `gmapps`;
    CREATE TABLE `gmapps` (
    `name` varchar(100) NOT NULL default '0',
    `age` int(10) unsigned default NULL,
    `accountname` varchar(100) default NULL,
    `experience` varchar(100) default NULL,
    `why` tinytext NOT NULL
    )
    GM Contact (contact.php)
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <
    HTML>
    <
    HEAD>
        <
    META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
        <
    TITLE>GM Contact</TITLE>
        <
    STYLE TYPE="text/css">
        </
    STYLE>
    </
    HEAD>
    <
    BODY LANG="nl-NL" DIR="LTR">
    <
    P ALIGN=CENTER><BR><BR><BR><BR>
    </
    P>
    <
    H1 ALIGN=CENTER>GM Contact</H1>
    <
    FORM ACTION="send_contact.php" METHOD="POST">
        <
    CENTER>
            <
    TABLE BORDER=1 CELLPADDING=5 CELLSPACING=1 FRAME=VOID RULES=GROUPS>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Accountname</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="account" SIZE=20 MAXLENGTH=30 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Charactername</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="charactername" SIZE=20 MAXLENGTH=30 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Reason</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="why" SIZE=20 MAXLENGTH=70 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                </
    TR>
                <
    TR>
                    <
    TD COLSPAN=4 BGCOLOR="#425984">
                        <
    P><FONT COLOR="#eeeeee"><INPUT TYPE=SUBMIT NAME="send_contact" VALUE="Send Application!"</FONT>
                        </
    P>
                    </
    TD>
                </
    TR>
            </
    TABLE>
        </
    CENTER>
    </
    FORM>
    <
    P ALIGN=CENTER><BR><BR>
    </
    P>
    </
    BODY>
    </
    HTML
    GM Contact (send_contact.php)
    PHP Code:
    <?php
    $host
    ['name'] = ''//Host (IP)
    $host['username'] = 'root'//Username
    $host['password'] = ''//Password
    $host['databasename'] = 'odinms'//DB

    $db mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to MySQL!');
    mysql_select_db($host['databasename'], $db);

    $account $_POST['account'];
    $charactername $_POST['charactername'];
    $why $_POST['why'];

    $sel "SELECT * FROM accounts WHERE name='$name'";
    $d "INSERT INTO gmcontact (account, charactername, why) VALUES ('$account', '$charactername', '$why')";
    mysql_query($d) OR die (mysql_error());
    echo 
    "Your information has been send to a GM!";
    ?>
    MySQL Code
    Code:
    DROP TABLE IF EXISTS `gmcontact`;
    CREATE TABLE `gmcontact` (
    `account` varchar(100) NOT NULL default '0',
    `charactername` varchar(100) NOT NULL default '0',
    `why` tinytext NOT NULL
    )
    Logout (logout.php)
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <
    HTML>
    <
    HEAD>
        <
    META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
        <
    TITLE>Log out!</TITLE>
        <
    STYLE TYPE="text/css">
        </
    STYLE>
    </
    HEAD>
    <
    BODY LANG="nl-NL" DIR="LTR">
    <
    P ALIGN=CENTER><BR><BR><BR><BR>
    </
    P>
    <
    H1 ALIGN=CENTER>Log out!</H1>
    <
    FORM ACTION="send_logout.php" METHOD="POST">
        <
    CENTER>
            <
    TABLE BORDER=1 CELLPADDING=5 CELLSPACING=1 FRAME=VOID RULES=GROUPS>
                <
    TR>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P ALIGN=RIGHT><FONT COLOR="#eeeeee">Accountname</FONT></P>
                    </
    TD>
                    <
    TD COLSPAN=2 BGCOLOR="#425984">
                        <
    P><INPUT TYPE=TEXT NAME="accountname" SIZE=20 MAXLENGTH=30 STYLE="width: 4.34cm; height: 0.64cm"></P>
                    </
    TD>
                <
    TR>
                    <
    TD COLSPAN=4 BGCOLOR="#425984">
                        <
    P><FONT COLOR="#eeeeee"><INPUT TYPE=SUBMIT NAME="send_logout" VALUE="Log me out!"</FONT>
                        </
    P>
                    </
    TD>
                </
    TR>
            </
    TABLE>
        </
    CENTER>
    </
    FORM>
    <
    P ALIGN=CENTER><BR><BR>
    </
    P>
    </
    BODY>
    </
    HTML
    Logout (send_logout.php)
    PHP Code:
    <?php
    $host
    ['name'] = 'localhost'//Host (IP)
    $host['username'] = 'root'//Username
    $host['password'] = ''//Password
    $host['databasename'] = 'odinms'//DB

    $db mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to MySQL!');
    mysql_select_db($host['databasename'], $db);

    $account $_POST['accountname'];

    $sel "SELECT * FROM accounts WHERE name='$name'";
    $d "UPDATE accounts SET loggedin = 0 WHERE name = '$account'";
    mysql_query($d) OR die (mysql_error());
    echo 
    "Account $accountname succesfully logged out!";
    ?>
    -AlmarM-


  2. #2
    Valued Member DtN is offline
    MemberRank
    Apr 2008 Join Date
    123Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    I'm just wondering, how come people don't use a textarea box to type experience, why one should be picked etc. instead of using input text?
    It gives a better view.

  3. #3
    Account Upgraded | Title Enabled! Regurgitate is offline
    MemberRank
    Apr 2008 Join Date
    1,113Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Nice Release, I'm going to try it out.

  4. #4
    Member AlmarM is offline
    MemberRank
    Apr 2008 Join Date
    79Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Quote Originally Posted by Avenge View Post
    I'm just wondering, how come people don't use a textarea box to type experience, why one should be picked etc. instead of using input text?
    It gives a better view.
    Ye but, I dont know how to use it in PHP & stuff

    -AlmarM-

  5. #5
    Visit my hompage Vi3tb0i2ty is offline
    MemberRank
    May 2008 Join Date
    1,788Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    wow thats nice

  6. #6
    Valued Member Pmang is offline
    MemberRank
    Jun 2008 Join Date
    Pie LandLocation
    101Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Party Like A rock star?

  7. #7
    Apprentice ZarkedOut is offline
    MemberRank
    Jun 2008 Join Date
    8Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    On Logout (logout.php), you are missing a closing bracket.
    PHP Code:
    <P><FONT COLOR="#eeeeee"><INPUT TYPE=SUBMIT NAME="send_logout" VALUE="Log me out!"</FONT
    should be
    PHP Code:
    <P><FONT COLOR="#eeeeee"><INPUT TYPE=SUBMIT NAME="send_logout" VALUE="Log me out!"></FONT

  8. #8
    Visit my hompage Vi3tb0i2ty is offline
    MemberRank
    May 2008 Join Date
    1,788Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Nice

  9. #9
    Account Upgraded | Title Enabled! Amandy is offline
    MemberRank
    Feb 2007 Join Date
    Crapvile, USALocation
    768Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    SQL Injections please :)

  10. #10
    Valued Member narut8251 is offline
    MemberRank
    Sep 2006 Join Date
    singaporeLocation
    123Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Nice

  11. #11
    Valued Member DtN is offline
    MemberRank
    Apr 2008 Join Date
    123Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Quote Originally Posted by AlmarM View Post
    Ye but, I dont know how to use it in PHP & stuff

    -AlmarM-
    It's pretty easy to learn! :) Just look at the code, and you will know.

    Instead of using this:
    <INPUT TYPE=TEXT NAME="experience" SIZE=20 MAXLENGTH=100 STYLE="width: 4.34cm; height: 0.64cm">
    Then this will transform it into a textarea box:
    PHP Code:
    <textarea name="experience" style="height:100px;width:200px;"></textarea
    It works just as same, but makes it into a textarea box instead. Simple.

  12. #12
    Valued Member GalaxyJoey is offline
    MemberRank
    Jun 2008 Join Date
    NetherlandsLocation
    140Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Live demo please?

  13. #13
    Novice rapidshot is offline
    MemberRank
    Jul 2008 Join Date
    4Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Join my hamachi to see the live demo ^_^

    Network name: MasterMs10

    Passwork: 1234

    And then just click on GM Application to see it in action
    (im only using gm application and gm contact atm i have my own logout page)
    :busted_co

  14. #14
    Account Upgraded | Title Enabled! PrinceReborn is offline
    MemberRank
    Jul 2008 Join Date
    United KingdomLocation
    261Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    I think this is liable to SQL injections. Use at own risk.

  15. #15
    Valued Member DtN is offline
    MemberRank
    Apr 2008 Join Date
    123Posts

    Re: [Release][PHP] GM App, GM Contact, Logout!

    Quote Originally Posted by rapidshot View Post
    Join my hamachi to see the live demo ^_^

    Network name: MasterMs10

    Passwork: 1234

    And then just click on GM Application to see it in action
    (im only using gm application and gm contact atm i have my own logout page)
    :busted_co
    Dude, why do you even bump this thread? Getting people to join your Hamachi? >_>



Page 1 of 2 12 LastLast

Advertisement