drupal_set_message($message = NULL, $type = 'status')
drupal/includes/bootstrap.inc, line 597
Set a message for the user to see.
The message is stored in the session so that it can persist through a redirect.
If called with no arguments, this function returns all set messages without clearing them.
function drupal_set_message($message = NULL, $type = 'status') {
if (isset($message)) {
if (!isset($_SESSION['messages'])) {
$_SESSION['messages'] = array();
}
if (!isset($_SESSION['messages'][$type])) {
$_SESSION['messages'][$type] = array();
}
$_SESSION['messages'][$type][] = $message;
}
return $_SESSION['messages'];
}