Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Just a little PHP tutorial


    House
     Share

    Recommended Posts

    Hi folks!

     

    I want to show you some basics of the PHP scripting language.

    PHP is a server-sided scripting language, so you will need a server to run the scripts on.

    ex: www.ghbsys.net

     

    with PHP you can retrieve IP adresses, send information to a server, to a database and send mails.

     

    If you want to execute a string of PHP, you write:

    <?php

     

    ?>

    and put the code inbetween it.

     

    I now give you a little example of a code, it takes an MD5-Hash of the input, and puts it out!

     

    Call the file:

    MD5.php

     

    <html>
    <head>
    </head>
    <body>
    
    Input:
    <form action="MD5.php" method="POST">
     <input type="text" name="input" />
     <input type="submit" name="submit" value="Take the hash!!!" />
    </form>
    
    <?php
    if(isset($_POST['submit']))
    {
    $input = $_POST['input'];
    $output = md5($input);
    alert $output;
    }
    ?>
    
    </body>
    </html>

     

     

     

    You can see, that there is a form.

    Form action: The file which the form refers to if the button with name: submit is pressed!

    Form method: Post/Get. Post = Send data discrete, Get=send data which is visible in the address bar.

     

    You can retrieve the information from input fields by write: $_POST[' the name of input field ']

    Or GET. Depends on the method you used.

     

    $ creates a variable.

    Variables can never start with a space or capital letter.

    if capital letter is used: $_POST

     

     

    REMEMBER: ALWAYS END EACH SENTENCE WITH A SEMICOLON ( ; )

    This means that you stop that from being executed any further.

     

    EXCEPTIONS: when you do:

     

    if(.....)

    {

     

    }

     

    Because everything after IF still belongs to the IF tab.

     

     

    the function if(isset($_POST['submit'])

     

    checks if the button is pressed, by short if the value is 1.

     

    alert outputs something by a message box.

     

    You can notice that the code is a little like javascript ( if {}) and ;

     

     

    I post more tutorials in a few days xD

     

    For questions:

     

    ICQ: 306-354-502

    MSN: [email protected]

    SKYPE: Fabinator4444

     

     

    have fun with PHP!!!

    Edited by Joachim Pfuetz
    Link to comment
    Share on other sites

    nice tut xD

     

    Thank you.

     

    I will add more!

    Many more.

     

    Also:

    registering

    Logging in

     

    SQL database

     

    and a little of javascript

    and javascript in connection with PHP!!!

    Link to comment
    Share on other sites

    uuuuh im interested in register and log in^^

    go on!

    Link to comment
    Share on other sites

    • 2 months later...
    • 3 weeks later...
    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...