here's my short function:
$messages = array();
function displayError($messages) {
echo "<b>Your action created an error(s) on the page</b><br /><br />";
echo "Your error(is) is/are:<br />";
echo "<ul>";
foreach($messages as $msg) {
echo "<li>$msg</li>\n
";
}
echo "</ul>";
}
then when I have an error I do...
$messages[] = "Error message";
and then i have:
//this was after i had tried ($messages) which i think
//should have worked
if($messages !== "") {
displayError($messages);
exit;
}
i have set global $messages; as well, and it doesnt' show my messages 🙁
it shows the rest of it though. What am I possible doing wrong? 🙁
let me know what you think. I'm thinking that my global $messages; isn't working properly, but I've used global alot before and I've never had a problem
thanks all 🙂