I have a problem with my custom code in the includes/modules/pages/contact_us/header_php.php page.

Part of it is listed below:

else {
$error = true;
if (empty($name)) {
$messageStack->add('contact', 'Name cannot be blank'); //ENTRY_EMAIL_NAME_CHECK_ERROR);
}
if ($zc_validate_email == false) {
$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
if (empty($enquiry)) {
$messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR);
}

if ($validate_security_code == false)
{
$messageStack->add('contact', 'Security Code does not match');
//zen_redirect(zen_href_link(FILENAME_CONTACT_US));
}


}

The statements in bold have been added by me.
The problem is that when $validate_security_code is false, the message 'Security Code does not match' is not displayed. However, if that line is commented, and the zen_redirect() line is uncommented, the re-direction occurs.

Can anyone explain this? How do I show the 'Security code ...' message?