Learn how to add methods to the Session class to allow it to manage the temporary storage of application messages so they can persist after a page redirect.
- [Instructor] In this movie,…we'll look at how we can improve our session class…by allowing it to manage our session messages.…When I talk about session messages,…what I'm referring to is the fact…that in some of our pages like edit.php,…once we have successfully updated one of these records,…we have session message equals…the admin was updated successfully.…And then we want to display that on future pages as well.…So the way that we do that is with the staff header,…we need to have something here that says…display_session_messages…and that will tell us those reports of whether or not…something has been added to the session.…
We have this function already existing,…display_session_message…exists inside our status and error functions.…And if we scroll down here, you'll see what it does.…It calls get_and_clear_session_message.…If it's set, then it displays some HTML…with the message inside of it.…Get and clear it both finds out if it's there,…retrieves it, and unsets it from the session.…Now that all works just fine and we could leave it as is.…
Note: This is an intermediate-level training course that assumes you have existing knowledge of PHP. To refresh your skills, check out PHP Essential Training and PHP: Object-Oriented Programming.
- Creating a project database and tables
- Connecting to the database
- Database queries with OOP
- The active record design pattern
- Defining a database-driven class
- Performing common database tasks with OOP
- Creating inheritable and reusable code
- Object-oriented user authentication
- Object-oriented pagination
Skill Level Intermediate
Consuming RESTful APIs in PHP with Guzzlewith Justin Yost2h 12m Intermediate
PHP: Accessing Databases with PDO and MySQLiwith David Powers3h 47m Intermediate
1. Overview and Project Setup
2. The Database Connection
3. Define a Database-Driven Class
4. Object-Oriented CRUD
5. Object-Oriented Authentication
6. Object-Oriented Pagination
- 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.