PHP Lesson 27 – Using POST Data After the Submit Button

Php

Video is ready, Click Here to View ×


Using the POST method to send data in a form will allow the the global array $_POST to store the information in memory. In this lesson I echo out the values that were entered in the textboxes to show how to use the data submitted to a form.

This video is part of a series on PHP Development. This PHP Development series is designed to teach both current and new programmers web development techniques in a step-by-step guided approach. Any images used are part of the Creative Commons License….

10 thoughts on “PHP Lesson 27 – Using POST Data After the Submit Button

  1. I am trying to do an activation page but whenever I add another file to my form action, that same page does not get process. I guess that is the purpose of the form action but is there a way to get the first page process first, so that information can be entered into the database and then change the form action to another page called activate.php?

  2. I copied this exactly and get a notice that I have an undefined variable at each of the echo lines.
    "Notice: Undefined variable: _post in / file location/ formtest.php on line 8".
    The from from the previous video works as shown. Once the echo command lines are added it doesn't work.

  3. Hello I have a question for you ai hsve copied all of your steps but for some strange reason when I try to echo any thing back to my screen it won't show up. I'm usinf the Xampp and I'm in my localhost in the  addrtess bar and I'm typing in localhost/page1.php and I'm trying to echo the words that you did like Mathew, and Huges and it still won't show on my screen. here is the code that I used to try in get it to scho to me.<html>
    <head>
    </head>
    <body>
    <?
    echo $_POST['fname'];
    echo $_POST['lname'];
    echo $_POST['about'];

    ?>

    <form action="page2.php" method="post">
    First Name: <input type="text" name="fname"><br />
    Last Name: <input type="text" name="lname"><br />
    About: <textarea name="about"></textarea><br />
    <input type="reset" name="reset">
    <input type="submit" name="submit" value="Go">
    </form>
    </body>
    </html>

    Please let me know if there is something in my browswer that would prevent me from recieving the scho. I need the cho to work so that it can state when they have successfully connected or stc…. please give me a hand here.

    Thanks,

  4. $_POST['fname'], the name of the input you want to get the data from.
    you can assign it to a variable, $firstName = $_POST['fname'];
    use single quotation marks.

Leave a Reply

Your email address will not be published. Required fields are marked *