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 - PHP Tutorial
From the course: Learning PHP
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
GET vs. POST3m 29s
-
(Locked)
Handling basic form elements3m 37s
-
(Locked)
Handing multiple-choice elements4m 44s
-
(Locked)
Form validation: Making sure required fields are filled in7m 8s
-
(Locked)
Form validation: Appropriate input4m 14s
-
(Locked)
Form validation: Sanitizing input9m 5s
-
(Locked)
Sending the form data in an email7m 9s
-
(Locked)
Challenge: Process a simple form and send the email42s
-
(Locked)
Solution: Process a simple form and send the email4m 24s
-
-
-