From the course: PHP with MySQL Essential Training: 1 The Basics
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Detect form submission
From the course: PHP with MySQL Essential Training: 1 The Basics
Detect form submission
- [Instructor] In this movie, we'll discuss how we can tell when a form has been submitted. Let's begin by understanding why we might want to know that. Here I am on the create.php page that we created and used in the last movie. The way that we used it was that we had a new.php page that submitted its form data over to create.php. So this was a POST request to create.php, which contain the form data here. And then we had create.php that processed that data. It did some very simple processing, it just simply read the values back and put them on the screen for us. But I want you to notice that even though we made a POST request to create.php, it's also possible for us to make a GET request. All we have to do is click on the URL up here in the browser bar at the top and hit Return, and now I've issued a GET request to the same URL. In this case, our create.php he handled the page just fine. We didn't get any errors back or anything like that. But that's not always necessarily the case…
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.