<?php

renderMessages(INFO_MESSAGES_SESSION_KEY, 'info-messages');
renderMessages(ERROR_MESSAGES_SESSION_KEY, 'error-messages');
function renderMessages($messagesKey, $cssClass)
{
    if (isset($_SESSION[$messagesKey]) && count($_SESSION[$messagesKey]) > 0) {
        echo '<ul class="' . $cssClass . '">';
        foreach ($_SESSION[$messagesKey] as $msg) {
            echo "<li>" . htmlspecialchars($msg) . '</li>';
        }
        echo '</ul>';
    }
    $_SESSION[$messagesKey] = [];
}
<div id="header"<?php 
if (!isLoggedIn()) {
    ?>
 class="header-login"<?php 
}
?>
>
  <div id="header_padding">
    <? include("includes/menu_tabs.php"); ?>
  </div>
</div>

<div id="main">
	<?php 
renderMessages();
?>
	<?php 
$this->render();
//renderAction()
?>
</div>

<!-- BEGIN Sidebar -->
<? include("includes/left_menu.php"); ?>
<!-- END Sidebar -->

<div id="footer_gutter">&nbsp;</div>
<div id="footer">
  <div id="footer_padding">
    <p>Copyright &copy; 2009 Rensselaer Polytechnic Institute (<a href="http://webtech.union.rpi.edu">Web Technologies Group</a>)</p>