[thelist] PHP - Email comes to a central server, then is re-r outed by zip c ode or city. How do I do this?

Colin Mitchell colspan at jerkvision.com
Mon Oct 21 20:14:01 CDT 2002

> I hesitate to offer code since I don't work with PHP much, but
> you need to match that ZIP code from the form against a table that
> associates all ZIP codes with an email address.
> That said, depending on how complex the correlation -- can you say
> all ZIps between 93100-97799 go to one email, or is the breakdown
> really granular -- you might want to fork off a separate process to
> take forward the mail and let the original return a thank you page
> to the submitter without waiting.

Another option would be to grab one of those zip+4 databases that has
latitude and longitude for each zipcode.  Then you could take the incoming
zipcode and do an only vaguely complex (once you've got the math down)
calculation to determine which email destination is closest to your starting
point.  That said, this really depends on what your server setup is, and it
assumes that you always want to send the email to the closest destination.



More information about the thelist mailing list