Can any one tell me whats wrong with this function?, I am a Newbie in PHP
Function in "\includes\functions\functions_general.php" to Check
PHP Code:
// VALIDATE POSTCODE START
function tep_validate_postcode($country_id, $postcode)
{
$postval =$db->Execute( "select countries_postal_validation from countries where countries_id = '" . (int)$country_id . "' limit 1");
if (zen_not_null($postval->fields['countries_postal_validation']))
{
return (preg_match($postval->fields['countries_postal_validation'], $postcode));
}
else return true;
}
// VALIDATE POSTCODE END
Checking of entry in "\includes\modules\pages\address_book_process\header_php.php"
PHP Code:
if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
$error = true;
$messageStack->add('addressbook', ENTRY_POST_CODE_ERROR);
}
// VALIDATE POSTCODE START
if (tep_validate_postcode($country, $postcode) == false)
{
$error = true;
$messageStack->add('addressbook', ENTRY_POST_CODE_VALID_ERROR);
}
// VALIDATE POSTCODE END
Thanks in Advance
Vinod
Bookmarks