From the course: Learning PHP

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Handling basic form elements

Handling basic form elements - PHP Tutorial

From the course: Learning PHP

Start my 1-month free trial

Handling basic form elements

- [Instructor] There are all sorts of form elements you can use to capture input from users. So what exactly do we mean by basic elements here? Essentially, a basic element is any element that sends a single value for the field. In other words, most elements. We'll go through some of the most common form fields in this section but it will not cover all elements. If you're ever unsure, be sure to use var dump or print R to see what's going on. Speaking of, let's take another look at the post array from earlier. You can see that it's an associative array and the keys match the name of the form field. So if we go back to our code, you'll see that our method is post, and now we have a new action attribute here. The action attribute is the page that should process the form. And I've created a new file called process.php here to make the form processing a little clearer. In order to process the basic form elements, we can…

Contents