In this video, you will discuss several techniques for showing errors to the user, as well as add code to display validation errors followed by the original form containing the user-submitted values.
- [Instructor] In this movie,…we'll talk about how you display…any validation errors you have…back to the user.…The first thing about our validations errors is…that we want to let the user know what they are…with the idea that we want them to fix it…and try again.…So we want to show them the same form…that they submitted again,…and we want to give them back the values…that they submitted to us,…not the original database values,…but the values they provided…so they can see what's wrong.…If we said something was blank,…then it ought to look blank for them…so they can fill it in.…The second thing we want…is we want to tell them what the errors were.…
There're a couple of ways we could point that out.…We could indicate the errors at the top of the page…as a bulleted list.…Here's the five things you need to fix.…That's the approach that we're going to take,…and that's kind of what we started…by doing in the last movie…where we just built up a simple errors array…of all the things that are wrong.…There's also another approach…
- 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.