Compare several strategies for detecting when a form is submitted. Write PHP code to detect whether an HTTP request is a POST or GET request.
- [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 is that we had…a new dot php page that submitted its form data…over to create.php, so this was a POST request…to create.php, which contained 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 handled the page…just fine, we didn't get any errors back…or anything like that, but that's not always necessarily…the case.…It might be that we want this page to be dedicated…
- Organizing project files
- Including and requiring files
- Working with URL parameters
- Encoding dynamic content
- Modifying headers and page redirection
- Creating forms and processing form data
- MySQL basics
- Using PHP to access database tables
- Creating, reading, updating, and deleting database records with PHP
- Validating data
- Preventing SQL injection
Skill Level Beginner
1. Start a Database-Driven Project
2. Build Web Pages with PHP
3. Headers and Redirects
4. Build Forms with PHP
5. MySQL Basics
6. Use PHP to Access MySQL
7. CRUD with PHP
8. Validate Data with PHP
9. Prevent SQL Injection
Next steps1m 8s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.