From the course: PHP: Object-Oriented Programming with Databases

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Session messages

Session messages - PHP Tutorial

From the course: PHP: Object-Oriented Programming with Databases

Start my 1-month free trial

Session messages

- [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…

Contents