LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-24-2012, 05:17 PM   #1
Dafydd
Member
 
Registered: Oct 2008
Posts: 315

Rep: Reputation: 23
convert a town, state into a zip code


I need a link to an open source PHP function that will allow me to enter the name of a town, state and get the zip code. That I can then send the result to a PHP proximity function for the surrounding towns.

I am finding plenty of code to convert a zip code into a town but nothing to convert a town in to a zip code.

Can anyone help?
TIA
Dave
 
Old 11-24-2012, 08:45 PM   #2
corp769
Guru
 
Registered: Apr 2005
Posts: 5,814

Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
Just a thought... If you found the code to convert from zip to town, then why not reverse engineer the code to do what you need it to do?
 
Old 11-24-2012, 10:55 PM   #3
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,423

Rep: Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158
As far as I know you have to buy that information.
 
Old 11-24-2012, 11:02 PM   #4
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Rep: Reputation: 81
In my city, it has 15 different zip codes more or less. So just having the city and state alone may not be enough information.

This question has been asked and answered many times according to Google. One link I found using the Google Maps API,

http://www.wearehathway.com/blog/tec...oogle-maps-api

Others:

https://www.google.com/search?q=api+to+find+zip+code
 
Old 11-25-2012, 01:56 AM   #5
Dafydd
Member
 
Registered: Oct 2008
Posts: 315

Original Poster
Rep: Reputation: 23
Perhaps I need to explain what I want to happen.
Background:
I like to go see/hear independent musicians sing. House concerts, listening rooms. church outreach, and any other venue.
Recently I was in Cedar Creek Texas at house concert. Cedar Creek is a small community outside of Austin. Early afternoon timing over about 5. Since I was withing 20 minutes of Austin and 2.5 hours of home, I ask around who was playing in Austin I might want to see. No one, either musician or patron could tell me anything.

What I would like to make available:
Musician log on, enter date, city, state, name, their URL, venue URL or Email.

Me: go to website, type in date, city.
I would get back a listing of all playing on that date within a 60 mile range. Would looks something like this.
Code:
Dec. 8, 2912 La Grange TX Marcia Ball http://marciaball.com/  http://www.thebugleboy.org/
I would already know the zip for La Grange because I could find it if I were to plug it in into a proximity function using my zip and a 100 mile radius. But what if I was going to Bloomington Indiana and wanted to be sure there were tickets available.

I would seem to that for to work is finding all the zip codes.

Last edited by Dafydd; 11-25-2012 at 02:12 AM.
 
Old 11-25-2012, 02:10 AM   #6
Dafydd
Member
 
Registered: Oct 2008
Posts: 315

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by corp769 View Post
Just a thought... If you found the code to convert from zip to town, then why not reverse engineer the code to do what you need it to do?
I've thought about that. My coding skills are not that strong. Though I may have to improve them.
 
Old 11-25-2012, 03:35 AM   #7
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,872

Rep: Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523Reputation: 1523
http://developer.yahoo.com/geo/geoplanet/
 
Old 11-26-2012, 02:50 AM   #8
Dafydd
Member
 
Registered: Oct 2008
Posts: 315

Original Poster
Rep: Reputation: 23
I have found HTML code that uses the < form > tag and returned zip codes for the town. But it displays it on their website.
I need to examine the source code to their website and see if I can glean enough information to be useful and not not infringe on any copyrights.

Code:
<form name="form1" method="post" action="http://www.zip-codes.com/search.asp" target="_blank">
<table border="0" cellpadding="2" cellspacing="0">
<tr align="center"><td colspan="2"><b>Find ZIP Code of a City</b></td></tr>
<tr><td>Town/City:</td>
<td><input name="fld-city" type="text" size="15"></td></tr>
<tr><td>State:</td>
<td><input name="fld-state" type="text" size="5" maxlength="2"></td></tr>
<tr><td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Search"></td></tr>
<tr align="center"><td colspan="2"><a href="http://www.zip-codes.com" target="_blank" title="Free ZIP Code Finder and ZIP Code Database">Provided by Zip-Codes.com </a></td>
</tr></table>
</form>

Last edited by Dafydd; 11-26-2012 at 02:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a batch of 7z files to zip don_wombat_73 Linux - Newbie 4 10-11-2012 02:47 PM
have not been able to open are convert zip and rar files to something useable. rich2you Linux - Newbie 4 07-19-2012 03:11 PM
[SOLVED] Small matlab code to convert Morse code to plaintext using regular expressions gregorian Programming 3 03-31-2010 01:34 PM
Could someone convert a tar to zip? SkunkyMonkey General 4 02-07-2009 06:18 AM
pls convert this windows code into linux code nagendrar Programming 6 06-03-2008 08:00 AM


All times are GMT -5. The time now is 08:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration