If you want to show a success message or an error message in your custom module or in anything else in magento, we can use the addSuccess() and addError() functions. These functions show the respective messages in the magento format. You don’t have to build a seperate markup for you custom module messages you can use the magento default html for showing messages using the 2 functions.
Showing messages on the frontend
$message = 'Your message ... ';
Mage::getSingleton('core/session')->addError($message);
Mage::getSingleton('core/session')->addSuccess($message);




