I've got my hands on a custom template. It was a storefront custom login box so It's easy for customers to login but it does not work. When customers enter their valid info, they get re-directed to the fallowing error message:
"There was a security error when trying to login."
I Googled it and found a possible solution:
https://www.zen-cart.com/tutorials/i...hp?article=312
I have applied the
zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
To the custom login form, but I still get the same error.
This is the complete code.
?php
if (!isset($_SESSION['customer_id'])) {
$loginboxcontent = zen_draw_form('footer_login', zen_href_link(FILENAME_LOGIN, 'action=process', 'SSL')) . '
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>' . AZ_SIGN_IN_TEXT . '</td>
<td style="padding-left:4px;">
<div class="az_inputbox_l"><div class="az_inputbox_r"><div class="az_inputbox_m">' .
zen_draw_input_field('email_address',AZ_EMAIL_TEXT , 'size="25" onfocus="if(this.value == \'' . AZ_EMAIL_TEXT . '\') {this.value = \'\';}" onblur="if (this.value == \'\') {this.value = \'' . AZ_EMAIL_TEXT . '\';}"') .
'</div></div></div>
</td>
<td style="padding-left:2px;">
<div class="az_inputbox_l"><div class="az_inputbox_r"><div class="az_inputbox_m">' .
zen_draw_password_field('password', AZ_PASSWORD_TEXT , 'size="25" onfocus="if(this.value == \'' . AZ_PASSWORD_TEXT . '\') {this.value = \'\';}" onblur="if (this.value == \'\') {this.value = \'' . AZ_PASSWORD_TEXT . '\';}"') .
zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
'</div></div></div>
</td>
<td align="right"><input id="az_login_button" type="submit" name="' . IMAGE_BUTTON_LOGIN . '" value=">" title="' . IMAGE_BUTTON_LOGIN . '" /></td>
</tr>
</table>
</form>
';
} else {
$loginboxcontent = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="az_inputbox_l"><div class="az_inputbox_r"><div class="az_inputbox_m"> ' . $tmpl['txt']['loginout'] . ' </div></div></div></td><td> <a id="az_logout_text" href="'.zen_href_link(FILENAME_LOGOFF, '', 'SSL').'">></a></td></tr></table>';
}
echo $loginboxcontent;
?>
Any thoughts why wouldn't this work? What else would I need to add/take out?
Any input is greatly appreciated.



