Forums / General Questions / messageStack Puzzle

messageStack Puzzle

Locked

Started by hengster on 31 Aug 2010, 7:35 AM · Views: 1,037

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
31 Aug 2010, 7:35 AM
#1
hengster avatar

hengster

New Zenner

Join Date:
Aug 2010
Posts:
1
Plugin Contributions:
0

messageStack Puzzle

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?