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.

    Get and Post!


    meijör
     Share

    Recommended Posts

    Hello friends of the serverbased programming.

     

    This is an intruduction to what GET and POST are.

    The built-in $_GET function is used to collect values from a form sent with method="get" or just by URL encoding.

     

    It's the easiest way to give a vaiable a value.

    Little example

    <html>
    (..)
    <?php
        $insult = $_GET['insult'];
    ?>
    <form method="get">
    Insult here : <input type="text" name="insult" size="14">
    <br /><input type="submit" value="insult me">
    </form>
    <?php if ($_GET)
     {
               echo("<h1> You are such a/an".$insult."</h1>");
     }
    ?>

    The URL of that would be %youfilename.php?insult=Bitch

    So you can redirect to those things just by link without filling out forms.

     

    The built-in $_POST function is used to collect values from a form sent with method="post".

    Post works just as GET but it does not show it's values through the URL. So it's invisible for the user.

     

    Pro's and Contra's.

     

    GET : Easy to use via URL but not good for secure information.

    POST : Not visible through URL but a form needs to be filled each time.

     

     

    That's just all for now, ill maybe extend it.

    Link to comment
    Share on other sites

    A little bit more from me:

     

    You can build up your page very simple without frames, because frames are just ugly and look Biene Majaish. Also you can't refresh other frames, so that you will have a bad, slow, inefficient, ugly bastardsite.

     

    For example, you got your menu on top:

    <a href="../index.php?page=home">Home</a> <a href="../index.php?page=poop">Poop</a>

     

    then you will put this in your mainpage:

     

    <div id="mainpage">
    <?php
    switch($_GET['page'])
    { 
    case "home":
    include("home.php");
    break;
    
    case "poop":
    include("poop.php");
    break;
    }
    ?>
    </div>

     

    As you can see, you can just put some PHP info up in the url O.o

    It retrieves it then with $_GET[' and then the name of the ?page or so '];

    checks it, and then for every cases includes a file xD

    You can build up a page easily without frames ;)

     

    Also, you can give $_GET things easily with the header() function, for example:

    if( 1 == 1 )
    {
    header("location: ../index.php?page=somepageyoudontwant", 5);
    echo("Haha, now you gave some get information that you didn't want^^");
    }

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

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