Flash message in php

## include this in every page..

if(isset($_SESSION["errormsg"])) 
{
    $error = $_SESSION["errormsg"];
    session_unset($_SESSION["errormsg"]);
}
else
{
   $error = "";
}

## For showing the message just
  
    echo $error;

## Set session with with message,when want to show message
  
    $_SESSION["errormsg"] = "This message will be shown there";

Leave a Comment