Learn how to create a PHP form which submits to the same page and why this is a useful technique.
- [Instructor] In the last movie we learned…how to detect when a form was being submitted to a page…or whether the page was being loaded directly.…We used it to redirect whenever it was not a post request.…We can also use this same technique…to do something I call single-page form processing.…The idea is that we have a single page…which contains both the form and the code…to process that form.…In other words, we'll have a form that submits to itself.…There's nothing wrong with having the form…and the form processing on two separate pages…like we did with new and create,…but having them on one page adds a few nice perks.…
The first is just that all of the logic related to the form,…how it's displayed and how it's processed,…is all self contained in a single file.…We haven't talked about form errors yet…and when we do we'll realize that when there's a problem…with the form we're going to want to redisplay the form…back to the user so that they can fix it.…We don't want that data to just simply disappear,…we want to represent the form to the user…
- 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.