Read POST Form Data with PHP

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:00
    Read POST Form Data with PHP
  • 0:01
    with Leanna Pelham
  • 0:09
    That's done with this super magic variable called $_POST.
  • 0:13
    Try it.
  • 0:14
    Let's use my favorite debugging tool, var_dump(), on this variable.
  • 0:22
    Fill out the form again and submit.
  • 0:29
    It prints out an associative array.
  • 0:31
    Each key is from the name attribute of the field,
  • 0:33
    and its value is what we typed in.
  • 0:36
    Wait.
Loading ...

Read POST Form Data with PHP

Loading...

In this tutorial we will work with the PHP $_POST variable, along with the $_SERVER variable to capture the information from our form. We'll need to make sure our code is specifically looking for POST data, instead of GET, by using some logic.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.