Support Forums

Finishing Up - Users State and City Auto populated based on ZIP Code entered US Only

This is a discussion on Finishing Up - Users State and City Auto populated based on ZIP Code entered US Only within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Just wanted to see if there was any interest in a modification I am making for US based Classified Sites ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 03-21-2011, 02:18 AM   #1
Customer
 
Join Date: Mar 2011
Posts: 52
Rep Power: 4
TheTechGuru is on a distinguished road
Default Finishing Up - Users State and City Auto populated based on ZIP Code entered US Only

Just wanted to see if there was any interest in a modification I am making for US based Classified Sites (International May Be Coming Soon depending on interest, since I dont really need it).

I got tired of the idea that any user can come in and populate my database with a fake city or misspelled (Pheonix, Phoenix, etc) city upon signup, which could in turn make the city dropdown on the search page and city variables throughout the site look very unprofessional.

I just finished up a modification that will populate the city, state, longitude, latitude, and even county based on the zip code they enter for any US state. The modification consists of a database with over 45,000 entries, a php script and minor modifications to the signup template.

Now its just on to testing. I wont really be using it for signup because I am focusing on using it for listings, which will allow members to submit ads that might be in different locations (real estate etc) instead of forcing every ad location to be their signup location.

But the signup part is done for those that are interested.

Im gonna test it for a few days, and make any changes I may deem important or adds functionality.

If anyone is interested let me know, I will charge a really fair price for the time its taking me, since I was coding it anyways. nothing more, nothing less.

It makes no changes to the existing php files as of right now. Will work for 4.0.x and up.
TheTechGuru is offline   Reply With Quote
Old 03-21-2011, 09:55 AM   #2
Customer
 
Join Date: Mar 2011
Posts: 52
Rep Power: 4
TheTechGuru is on a distinguished road
Default

Finishing up a Canadian Version Now.

Just to be clear, this will auto populate a users city, state (in this case province) etc, based off a simple input of a zip code or postal code. And will populate those said fields on the fly, dynamically.


The beauty of it is, you can easliy disable state/province, country, city etc fields, so they can see the data being populated in the disabled text fields, but they can not change it. The only way to change it is by changing the zip/postal code.

And if for some reason they leave the postal code empty, the standard validation kicks in and will not let them register until they have submitted that info.


Both My US and Canadian Databases are fairly extensive, so everything should be covered. Now all thats left to do is plan for a situation in the future of zip code changes, or city changes. This will be done in a pretty cool way, and will speak about it later.

longitude and latitude is also included each zip/postal/city, so if someone wanted to tie in google maps or some sort of geo function in the future, it will be a snap.
TheTechGuru is offline   Reply With Quote
Old 03-23-2011, 11:45 AM   #3
Customer
 
Join Date: Mar 2011
Posts: 52
Rep Power: 4
TheTechGuru is on a distinguished road
Default

No changes to any existing php files...

First Version is done (US), just looking for a live site to allow people to demo it. The good news is, its completely compatible with the search by zip code mod offered on classifiedmods just in case anyone has it installed.

Basically, once a user inputs their zip, it will automatically fill in the respective city state and country as they type.

The database this uses is bigger by about 10,000 more entries though than the one supplied with the search by zip code mod. (My Zip Database hase roughly 47,000 entries), so those that have the search by zip code mod, might want to consider looking into this modification to get this bigger database which will allow more exact radius searches.

The good news is that I am working on a Canadian Version, and a European Version tonight, and they will all work together. You wont be stuck with just US, you can utilize them all at the same time.

If you want a way to keep people from misspelling their city, or entering in jibberish which will make your city drop down in search look terrible, than you should check on this post, and I will update it as soon as I find someone willing to host it for demonstration.

For those of you that want to allow someone to enter input, in the unlikely case that their city isnt found after they input their zip, good news Im working on something that will allow them just to put in the next major city closest to them, and at the same time, request that their location be put into the system. After you approve their selection, you will be able to submit it from and admin type panel, and their info will be updated.

Stay Tuned for more...

Last edited by TheTechGuru; 03-23-2011 at 12:10 PM.
TheTechGuru is offline   Reply With Quote
Old 03-23-2011, 01:26 PM   #4
Scotty
 
Join Date: Apr 2010
Posts: 29
Rep Power: 6
pickyourownpet.com is on a distinguished road
Default

I am very interested! Keep us updated!
pickyourownpet.com is offline   Reply With Quote
Old 03-23-2011, 01:32 PM   #5
Customer
 
Join Date: Mar 2011
Posts: 52
Rep Power: 4
TheTechGuru is on a distinguished road
Default

Just finished with the canadian version.

Is there anyone from Canada here? Or Know about the amount of postal codes? My database of postal codes says 700,000 entries? that seems rather large.

Its working fast and fine, but I think Im gonna do a bit of research on the database I have, as I know absolutely nothing about Canada, other than they are above us.
TheTechGuru is offline   Reply With Quote
Old 03-23-2011, 01:41 PM   #6
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

There are 1,620 postal codes for Canada. (I sell the Postal Codes Module for almost every country in the world)
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 03-23-2011, 01:50 PM   #7
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by Mike-N-Tosh
There are 1,620 postal codes for Canada. (I sell the Postal Codes Module for almost every country in the world)
I need to clarify that answer, there are 1,620 Forward Sortation Area Codes (FSA) If you also use the Location Delivery Unit (LSU) then it goes up substantially. The LSU is like the +4 US zip code extension. Many countries have a similar type extension that may or not be relevant to doing this type of development. Most times it is NOT relevant.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 03-23-2011, 02:07 PM   #8
Customer
 
Join Date: Mar 2011
Posts: 52
Rep Power: 4
TheTechGuru is on a distinguished road
Default

Yeah, thats a pretty big database, I may have to look for a condensed version. Not sure if it can be done, as this is pulled from the database by postal code, and a condensed version would obviously be missing postal codes.

the wikipedia says "This scheme allows for a maximum 3,600 FSAs: with 2,000 possible LDUs in each FSA, there is a theoretical maximum of 7.2 million codes"

Why in the world would they ever need to use that many?? Holy Cow!

If they ever reach 7 million combinations, I would think that would be more of burden, than helping as the codes are intended to do.

The database I have does indeed have 700,000 records, I see a lot of provinces and cities being duplicated, however I dont see any postal codes duplicated. If I want to truly account for every postal code possible, I may have to keep it as is.

Any tips Mike-N-Tosh?
TheTechGuru is offline   Reply With Quote
Old 03-23-2011, 02:38 PM   #9
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default

I am a canadian user and I am also very intrerested in this module. Since there are six digits/letters in a postal code, (ex: H2H 2H2) there will be more possibilities then US zip code which is 5 I believe. (ex: 90210).

I replaced the state fucntion to become cities and the country function to become provinces (to avoid gibberish). But with this mod I would not have to do this, even better!

I am running a test website right now for a V2 of my template, I could probably use it as a demo site for a while and test it for you.

Last edited by EnergyFreak; 03-23-2011 at 02:47 PM.
EnergyFreak is offline   Reply With Quote
Old 03-23-2011, 02:51 PM   #10
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

My advice in correlation of what you are doing is that you don't need anything but the FSA's to simply populate cities. Don't know what your DB is using as a "postal code" field. It sounds like (since you have 700K) it is using a full FSA-LSU as the field.

What you are reading in Wikipedia is the theoretical math applying the coding system as to the theoretical number of unique full codes that are possible, NOT what is actual in use. A mathematical equation. Compare it to say IP addresses like IPv4 which they just doled out the last of! IPv6 allows many more addresses. Same thing. A mathematical equation that gives you a huger number.

So, modify your existing db and extract just the FSA portion of the code. That will still be unique in your use to populate the city. The FSA is alphanumeric and is the first 3 characters. (e.g. "XDA", "TDL", "K2K", etc.). My guess is that will then bring your new db down to 1,620 postal codes give or take a couple.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing Filter and State + City sbhkma TemplateCodes 6 05-27-2010 01:35 AM
Search Results by city, state or zip LittleRascal Technical Support 2 02-27-2010 07:40 PM
City, state and country hel68c Technical Support 2 06-08-2008 04:07 PM


All times are GMT -4. The time now is 03:02 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0