oursolutionarchitectoursolutionarchitect

PHP how to handle user flash messages


PHP how to handle user flash messages via session

flash messages via session

Handle user flash messages via session variables which is more professional and easy to manage, How we can display these messages in traditional way, developers know how they display messages and update users about status of user operation(s) like

  • record save successfully
  • record updated successfully
  • Failed to create account, please try after a while

Most of new developers manage these kind of messages by sending the whole message in get variable, or some code for message like true for success message and false for error message.

like in the following example we have to redirect from add.php to index.php while sending message from add.php and displaying message on index.php