课程: Learning PHP

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Handling basic form elements

Handling basic form elements - PHP教程

课程: 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…

内容