Regex HTML Codigo Postal

Estoy intentando realizar un patrón para un código postal, pero no consigo realizarlo. Quiero que sea un numero de 5 digitos que sea entre 01000 y 52999.
El código que tengo ahora mismo es el siguiente:

        <input type="text"  pattern="[01000-52999]{5}d" name="codigoPostalDisco"> <br>

Create a redirect to the random postal system

I hope everyone is safe.

Ok, so I need some advice.
Basically, I have a blog where I want to have a button that leads to random posts on my WP website. I would also like to give my visitors the opportunity to filter by the type of posts (by category type) for which they would receive random posts.

For example:

Let's say my blog contains 5 categories of posts: dog, cat, bird, fish, wolf.

We have the "Random" button and next to it a selection by checkbox for each of these 5 categories. If the user selects the checkbox for "Dog" and "Cat" only, clicking the "Random" button will only load a random post from the "Dog" or "Cat" category. Not "bird", "fish" or "wolf".

I am currently temporarily setting 5 random buttons, one for each category. For example, if I click on the "Dog" category, I will see a random post from the "Dog" category. Of course, I want to replace this system with just a button and check box 5.
I would prefer that the script FIRST randomly choose one of the categories for which the check box is selected. And SECOND, to randomly select a post for this category.

Here is the code I have for the 5 buttons.
Can you help me change it to replace it with the check box system and a "random" button?

(NOTE: I use the "Redirect URL to post" plugin to generate the URL that redirects to a random post.)

(su_button url="" style="flat" background="#2D9600" size="20" center="no" rel="nofollow")DOG (/su_button)

(su_button url="" style="flat" background="#2D9600" size="20" center="no" rel="nofollow")CAT (/su_button)
(su_button url="" style="flat" background="#2D9600" size="20" center="no" rel="nofollow")FISH(/su_button)
(su_button url="" style="flat" background="#2D9600" size="20" center="no" rel="nofollow")BIRD (/su_button)
(su_button url="" style="flat" background="#2D9600" size="20" center="no" rel="nofollow")WOLF (/su_button)

I hope my explanation was clear.

Watch out.

magento2 – Magento 2.3.1: Postal code of the billing / delivery address automatically removes leading zeros

We have an issue where the billing / shipping addresses of an order automatically remove the leading 0 from a zip code. For example:

Danbury, Connecticut, 06811 becomes Danbury, Connecticut, 6811

This leads to some validation errors with UPS and other shipping APIs that are trying to validate 6811 as zip code.

How can we make it so that the invoice / shipment stores the full zip code with a leading zero?

SQL Server – SQL tables for postal codes


I am creating a database for a project that I am currently running, and this project contains addresses (customers, suppliers, etc.) whose addresses contain the postal code.

My question is as follows:

I have 3 tables – districts; counties; ZIP codes;

CREATE TABLE distritos(
    cd VARCHAR(2),  --Código Distrito
    nome_dist VARCHAR(50) not null,  --Nome Distrito
    PRIMARY KEY (cd),

CREATE TABLE concelhos(
    cd VARCHAR(2) not null, --Código Distrito
    cc VARCHAR(2), --Código Concelho
    nome_conc VARCHAR(50) not null, --Nome Concelho
    PRIMARY KEY (cc),
    FOREIGN KEY (cd) REFERENCES distritos(cd),

    cp_id INT IDENTITY(1, 1),
    cp_cc VARCHAR(2) not null, --Código Concelho
    cp_localidade VARCHAR(50) not null, --Nome Localidade
    cp_cp4 VARCHAR(4) not null, --CP4 Nº Código Postal
    cp_cp3 VARCHAR(3) not null, --CP3 Extensão Nº Código Postal
    cp_dp VARCHAR(50) not null, --Designação Postal
    PRIMARY KEY (cp_id),
    FOREIGN KEY (cp_cc) REFERENCES concelhos(cc),

What I'm up to is the relationship between these three tables, but I have a problem and can not imagine how to solve it.
The table ratio Concelhos with the table of Códigos Postais This is not possible because there are several communities with the same code and this is not unique.

I do not know if I have explained it well, but something is commenting and trying to explain it better.

magento2 – Magento 2 How do I get the postal code from the billing address in Observer?

I can not retrieve the zip code from the user's billing address. This is my code. Except for the zip code, which I can not retrieve, everything works fine.

$objectManager = MagentoFrameworkAppObjectManager::getInstance();

        $customer = $observer->getEvent()->getCustomer();
        $first_name= $customer->getFirstname();
        $last_name= $customer->getLastname();
        $taxVat = $customer->getTaxvat();

        //Billing Address variables

        $billingID = $customer->getDefaultBilling();
        $billingAddress = $objectManager->create('MagentoCustomerModelAddress')->load($billingID);
        $billingCompany = $billingAddress->getCompany();
        $billingZipcode = $billingAddress->getPostCode();
        $billingCity = $billingAddress->getCity();
        $billingState = $billingAddress->getRegion();
        $billingStreet = $billingAddress->getStreet();
        $billingStreet1 = $billingStreet(0);
        $billingStreet2 = $billingStreet(1);
        $billingTelephone = $billingAddress->getTelephone();

Best regards!