I have a business that provides leads by zip codes. When someone buys a license of my program, they have from 1 to 100 zip codes assigned to their account, which is identified by a unique URL.
I need a database with all USA postal codes and Canada postal codes and a php script with a simple, single query box for the postal code.
The logic of the script is to locate the licensee nearest the postal code that has been input and to automatically redirect them to the URL.
Additional "if" logic: If the postal code input is in a US State or Canadian Province (and there is only one licensee in the state) the browser needs to be redirected to that licensee's url.
If there is more than one, there needs to be some logic created to select the nearest geograhpical licensee and redirect to their url.
Therefore, there must be logic in db and query that connects postal codes with states or provinces.
There must be a simple admin/gui that will enable me to setup licensees and easily assign applicable postal codes to their URL.
For example, at present, I have one license in Louisiana - so if a person typed any postal code for Louisiana into query box, it would redirect them to the Louisiana licensee's URL.
I also have one in Alabama, one in Arizona, one in Maryland and soon will have others in all states and provinces and will have many in larger metropolitan areas.
Each licensee will have a unique set of postal codes assigned to them, however. Postal codes will NEVER be SHARED by licensees. It is how their geographical territories are defined.