Set message and show message after any action


function set_msg($msg, $type)
{
//error, success, info, warning
$a = “

x
“.$msg.”

</div>”;
$_SESSION[‘sess_set_msg’] = $a;
}
function get_msg()
{
if(isset($_SESSION[‘sess_set_msg’]))
{
echo $_SESSION[‘sess_set_msg’];
unset($_SESSION[‘sess_set_msg’]);
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s