Use SESSIONs.
PHP Code:$_SESSION['errMsg'][] = "Invalid Email Address"; //add array of messages to the session
One thing to keep in mind is that each page will need a "session_start();" at the top in order for this to work.PHP Code:if(isset($_SESSION['errMsg']) && is_array($_SESSION['errMsg'])) {
echo "<div class=\"msg\">";
foreach ($_SESSION['errMsg'] as $e) {
echo "* $e <br>";
}
echo "</div>";
unset($_SESSION['errMsg']); //clear the variable from session
}


Reply With Quote

Bookmarks