![]() ![]() |
Home |
How it works |
Projects archive |
Contact Us Air Compressor Bot |
|
| The Career Path of Freelance Programming Jobs |
Street Address Validator |
![]() |
Bidding Time: |
25/07/2008 17:36 - 08/08/2008 17:36 |
Budget: |
N/A |
Status: |
Closed |
|
|
|
Job Type: |
|
Description: |
I need a street validator built in PHP. I would like it to be a function or class. I would like it to be called via AJAX and return the results via AJAX. This is for one state so, we don't need them to type in city or state or even zip code. However, if they do, we will store the information for an easier look-up. I prefer someone who understands how street addresses work in the U.S. For example, someone could type all of the following and mean the same thing: 100 e 9th st 100 e 9th st manhattan ny 100 e 9th st manhattan,ny 100 e 9th st manhattan,ny 10003 100 e 9th st 100 e 9th street 100 e 9th st. 100 east 9th st ..etc. There could be a few other variations. I have notes/suggestions on how to approach: 1) Do some kind of top-level address validation via JavaScript before submitting to make sure the address looks okay (i.e. it starts with a numeric field) 2) Continue with JavaScript validation on next part of input to see if the length is acceptable (i.e. at least 3 characters) 3) alert user to correct address or submit via ajax with message to user (searching...) 4) input goes to server and is handled by PHP address validation function or class 5) splits input on space 6) checks and TRIMS(white space) pieces after split (*) - denotes mandatory - check for input[0] - street number (*) - check for input[1] - direction [e or w] (i.e east) - check for input[2] - street name (*) - could be input[1] if no direction - check for input[3] - street type - see below - check for input[4] - city - if user typed, we keep for reference - check for input[5] - state - if user typed, we keep for reference - check for input[6] - zip code - if user typed, we keep for reference hardcoded values to be used at end of routine to send to other script: $direction = '1'; $odd_even = "even"; Helpful pseudo logic: if input[1] == ('e' or 'w' or 'e.' or 'w.' or 'west' or 'east') && (numeric(substr(input[2],1))) //direction always followed by numeric street name then $direction = substr(input[1],1) and input[2] = street_name if input[3] (remove ".") then check if for type against valid array values (st,ct,rd,pl,ave,dr,nst,ln,loop,ter,pky,walk,sq,commons,reservation,path) OR CHECK: (user input=>valid value) For example, street, st., both should resolve to st (street=>st,court=>ct,road=>rd,place=>pl,avenue=>ave,drive=>dr,nst,lane=>ln,terrace=>ter,parkway=>pky,square=>sq) else input[1] = street_name if input[2], do same as for input[3] above ==check if street number is odd=== $i = 10; if ( $i&1 ) $odd_even = 'odd'; End result: I want the: odd_even variable direction value, if exists street number street name and city (if they typed it) This could evolve into more work. Your results should print directly under the input box. I DO NOT USE ESCROW. I WILL PAY AFTER YOU COMPLETE THE PROJECT SUCCESSFULLY. NO EXCEPTIONS. THANK YOU. Additional Info (Added 7/25/2008 at 17:43 EST)... street type should be returned as well. This project is the proprietary information of .
Click here to remove this project from OUR database.
|
Operating System: |
N/A |
Database System: |
N/A |
| <<< back |
|
| Home | Projects archive | RSS | Resources | Links | Contact Us | © 2004-2008 ProjectsList.biz /0.654 |