- if ((isOrderMultiPageEnabled()) && (isPostRequestElementSet('zip')) && (postRequestElement('zip') != '')) {
- // Choose recipients by ZIP code
- if (empty($sql)) {
- $sql = sprintf(" WHERE `zip` LIKE '%s%%%%'",
- bigintval(postRequestElement('zip'))
- );
- } else {
- $sql .= sprintf(" AND `zip` LIKE '%s%%%%'",
- bigintval(postRequestElement('zip'))
- );
+ if (isOrderMultiPageEnabled()) {
+ // Default is no zip code limitation
+ $zip = NULL;
+
+ // POST or GET elements?
+ if ((isPostRequestElementSet('zip')) && (postRequestElement('zip') != '')) {
+ // Choose recipients by zip code from POST
+ $zip = bigintval(postRequestElement('zip'));
+ } elseif ((isGetRequestElementSet('zip')) && (getRequestElement('zip') != '')) {
+ // Choose recipients by zip code from GET
+ $zip = bigintval(getRequestElement('zip'));