Flash Messages Revisited

Let's implement flash messages in a general way.

Including flash message file in the header file

Let’s implement flash messages in the most general way possible. We show them on specific pages only. We had already moved the presentation logic to the _flash_message.php snippet, but we still have to copy/paste it on every page. Including the _flash_message.php file in the _header.php file should do the trick, because every page will include this file, and therefore, indirectly include _flash_message.php too:

Get hands-on with 1200+ tech skills courses.