PHP Lesson 27 – Using POST Data After the Submit Button


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. For more information visit Lecture Snippets at



  1. you should have grouped the video together. misleading because you only say at the end that your explanation requires to call out another piece of code…

  2. 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?

  3. 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.

  4. when imran khan said 35 puncture thing , i didnot blv , but after having watched this program , i am doubts in favor of imran khan…………

  5. 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>
    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">

    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.


  6. $_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.

  7. Sir, I've got an error in $_POST['']; i don't know why, I try to use " " instead of ' ' but it is still not working, I've still an error on this XD! help please!


Please enter your comment!
Please enter your name here