Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Robert Cummings
Welcome back Richard :)

Cheers,
Rob.


On Thu, 2007-12-06 at 10:43 -0600, Richard Lynch wrote:
> On Thu, December 6, 2007 9:49 am, Jason Pruim wrote:
> >
> > On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:
> >
> >> On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> >>> Hi gang:
> >>>
> >>> I'm entertaining how to determine what zip codes fall within a 50
> >>> mile radius of another zip code.
> >>>
> >>> Anyone done this before?
> >>>
> >>> Also, does anyone have any sources for zip codes and lat/long
> >>> databases?
> >>
> >>Tedd,
> >>
> >>I have all of this in a MySQL database already, with census
> >> information, water table info, and more.  If you want to take a
> >> look,
> >> let me know and I'll give you a peek via phpMyAdmin to see if it'll
> >> match your needs.
> >>
> >>For you, it's free.  All else must PAY  ;-P
> >
> > You know...
> >
> > in the mailing industry people pay $1,000 a year for that kind of
> > info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak
> > a peak at it? Maybe I need to look into writing my own geo mapping
> > software...
> 
> The free one is from an OLD US census, paid for by taxpayers, and
> therefore Public Domain.
> 
> $1,000 ones (should) include new zips (lots) and up-to-date population
> info etc.
> 
> YMMV
> 
> -- 
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
> 
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Daniel Brown
On Dec 6, 2007 11:43 AM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> The free one is from an OLD US census, paid for by taxpayers, and
> therefore Public Domain.
>
> $1,000 ones (should) include new zips (lots) and up-to-date population
> info etc.

Yeah, mine actually does.  It's from 2006 and 2007 data, actually.
 I was just whining to read myself whine.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Richard Lynch
On Thu, December 6, 2007 9:49 am, Jason Pruim wrote:
>
> On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:
>
>> On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
>>> Hi gang:
>>>
>>> I'm entertaining how to determine what zip codes fall within a 50
>>> mile radius of another zip code.
>>>
>>> Anyone done this before?
>>>
>>> Also, does anyone have any sources for zip codes and lat/long
>>> databases?
>>
>>Tedd,
>>
>>I have all of this in a MySQL database already, with census
>> information, water table info, and more.  If you want to take a
>> look,
>> let me know and I'll give you a peek via phpMyAdmin to see if it'll
>> match your needs.
>>
>>For you, it's free.  All else must PAY  ;-P
>
> You know...
>
> in the mailing industry people pay $1,000 a year for that kind of
> info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak
> a peak at it? Maybe I need to look into writing my own geo mapping
> software...

The free one is from an OLD US census, paid for by taxpayers, and
therefore Public Domain.

$1,000 ones (should) include new zips (lots) and up-to-date population
info etc.

YMMV

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Daniel Brown
On Dec 6, 2007 11:12 AM, mike <[EMAIL PROTECTED]> wrote:
> You can use the formula to figure out how many zip codes are within the radius

Or you can stop shooting me in the ass by showing me things that
make me wonder why I wasted all that time!  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread mike
You can use the formula to figure out how many zip codes are within the radius

Here's a snippet of old code that did that:

$radius = 50; // in miles

$uchk = db_query("SELECT uz.zip FROM user_zip WHERE uid=$visitor[uid]");
if(db_numrows($uchk) == 1) {
list($vz) = db_rows($uchk);
$zchk = db_query("SELECT latitude,longitude
FROM z_data_zips WHERE zip=$vz");
list($vlat,$vlong) = db_rows($zchk);
db_free($zchk);
$zips = db_query("SELECT z.zip FROM data_zips
z WHERE CEIL(69*DEGREES(ACOS(SIN(RADIANS(z.latitude)) *
SIN(RADIANS($vlat)) + COS(RADIANS(z.latitude)) * COS(RADIANS($vlat)) *
COS(RADIANS(z.longitude - $vlong) < $radius");
$ziplist = "";
if(db_numrows($zips) > 0) {
while(list($zip) = db_rows($zips)) {
$ziplist .= "'$zip',";
}
db_free($zips);
$ziplist =
substr($ziplist,0,strlen($ziplist)-1);
$query .= " user_zips IN($ziplist)";
}
}
db_free($uchk);



On 12/6/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Dec 6, 2007 11:02 AM, mike <[EMAIL PROTECTED]> wrote:
> [snip!]
> > 1) download ZCTA (the text version) from
> > http://www.census.gov/geo/www/gazetteer/places2k.html
> [snip!]
>
>How you say?  Son of the bitch.
>
>Well, my database still has more information, including nearby ZIP
> codes, et cetera.  It's about 38MB, total.
>
>Still son of the son of the son of the bitch.  Great-grandson
> of the bitch.
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] zip codes and lat/longs

2007-12-06 Thread Jay Blanchard
[snip]
I'm entertaining how to determine what zip codes fall within a 50 
mile radius of another zip code.

Anyone done this before?

Also, does anyone have any sources for zip codes and lat/long databases?

TIA for any help/suggestions.
[/snip]

Here is a code snip that I use to determine things within a certain
radius (5 miles) of a zip code;

/* calcs for distance */
function distance($lat1, $lon1, $lat2, $lon2) { 
$theta = $lon1 - $lon2; 
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +
cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); 
$dist = acos($dist); 
$dist = rad2deg($dist); 
$miles = $dist * 60 * 1.1515;

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Daniel Brown
On Dec 6, 2007 11:02 AM, mike <[EMAIL PROTECTED]> wrote:
[snip!]
> 1) download ZCTA (the text version) from
> http://www.census.gov/geo/www/gazetteer/places2k.html
[snip!]

How you say?  Son of the bitch.

Well, my database still has more information, including nearby ZIP
codes, et cetera.  It's about 38MB, total.

Still son of the son of the son of the bitch.  Great-grandson
of the bitch.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread mike
After reading this I decided to figure out what the issue was.

It was the MySQL result set. Somehow the columns changed and messed up
the float values. So I just whipped this up quick to reload the data
(and possibly update it too)

Here's the quick-and-dirty:

1) download ZCTA (the text version) from
http://www.census.gov/geo/www/gazetteer/places2k.html
2) run this

db_query("TRUNCATE TABLE data_zips");

$fp = fopen('zcta5.txt', 'r');
while(!feof($fp)) {
$line = fgets($fp, 2048);
$line = chop($line);
$zip = substr($line, 2, 5);
$lat = substr($line, 137, 9);
$long = substr($line, 146, 12);
db_query("INSERT INTO data_zips(zip, latitude, longitude)
VALUES('$zip', '$lat', '$long')");
}
fclose($fp);

schema:

CREATE TABLE `data_zips` (
  `zip` mediumint(5) unsigned zerofill NOT NULL default '0',
  `latitude` float(9,6) NOT NULL default '0.00',
  `longitude` float(9,6) NOT NULL default '0.00',
  PRIMARY KEY  (`zip`),
  KEY `latitude` (`latitude`),
  KEY `longitude` (`longitude`));

I believe now you have everything you need :)


On 12/6/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> > Hi gang:
> >
> > I'm entertaining how to determine what zip codes fall within a 50
> > mile radius of another zip code.
> >
> > Anyone done this before?
> >
> > Also, does anyone have any sources for zip codes and lat/long databases?
>
>Tedd,
>
>I have all of this in a MySQL database already, with census
> information, water table info, and more.  If you want to take a look,
> let me know and I'll give you a peek via phpMyAdmin to see if it'll
> match your needs.
>
>For you, it's free.  All else must PAY  ;-P
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Daniel Brown
On Dec 6, 2007 10:49 AM, Jason Pruim <[EMAIL PROTECTED]> wrote:
>
> On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:
>
> > On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> >> Hi gang:
> >>
> >> I'm entertaining how to determine what zip codes fall within a 50
> >> mile radius of another zip code.
> >>
> >> Anyone done this before?
> >>
> >> Also, does anyone have any sources for zip codes and lat/long
> >> databases?
> >
> >Tedd,
> >
> >I have all of this in a MySQL database already, with census
> > information, water table info, and more.  If you want to take a look,
> > let me know and I'll give you a peek via phpMyAdmin to see if it'll
> > match your needs.
> >
> >For you, it's free.  All else must PAY  ;-P
>
> You know...
>
> in the mailing industry people pay $1,000 a year for that kind of
> info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak
> a peak at it? Maybe I need to look into writing my own geo mapping
> software...
>

You sell it, you can have 50% of whatever revenue it generates,
without having to do a bit of code.

It took me over a year to compile all of the information.  I know
I probably could've found it somewhere else for a few hundred dollars,
but I wanted to do it as a project for myself so I did.  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Jason Pruim


On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:


On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:

Hi gang:

I'm entertaining how to determine what zip codes fall within a 50
mile radius of another zip code.

Anyone done this before?

Also, does anyone have any sources for zip codes and lat/long  
databases?


   Tedd,

   I have all of this in a MySQL database already, with census
information, water table info, and more.  If you want to take a look,
let me know and I'll give you a peek via phpMyAdmin to see if it'll
match your needs.

   For you, it's free.  All else must PAY  ;-P


You know...

in the mailing industry people pay $1,000 a year for that kind of  
info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak  
a peak at it? Maybe I need to look into writing my own geo mapping  
software...


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Daniel Brown
On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> I'm entertaining how to determine what zip codes fall within a 50
> mile radius of another zip code.
>
> Anyone done this before?
>
> Also, does anyone have any sources for zip codes and lat/long databases?

Tedd,

I have all of this in a MySQL database already, with census
information, water table info, and more.  If you want to take a look,
let me know and I'll give you a peek via phpMyAdmin to see if it'll
match your needs.

For you, it's free.  All else must PAY  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zip codes and lat/longs

2007-12-05 Thread mike
Here's code I had, but it recently stopped working

It takes the zip code for the user and the user you're viewing, looks
them up from the data table (z_data_zips) and does the calculation.
The formula is in a handful of places - I converted mine from a MySQL
example (I think, or vice versa)

You can get the zip code lat/long info from the Census Bureau

I believe this is where you get the file:
http://www.census.gov/geo/www/gazetteer/places2k.html

You want the "ZCTAs (ZIP Code Tabulation Areas): (33,233 records)"
file - the schema is at the bottom of the page.

Perhaps someone else might also find the error in my code below that's
changed and save me the time to figure out why it no longer works :)
(for all I know it could be a problem with MySQL result set too)

if($visitor['uid'] > 0) {
$uchk = db_query("SELECT up.country,uz.zip FROM user_profile
up LEFT JOIN user_zip uz ON uz.uid=up.uid WHERE up.uid=$visitor
[uid]");
if(db_numrows($uchk) == 1) {
list($vc,$vz) = db_rows($uchk);
$vz = intval($vz);
$user_zip = intval($user_zip);

$zchk1 = db_query("SELECT latitude,longitude
FROM z_data_zips WHERE zip=$user_zip");
list($ulat,$ulong) = db_rows($zchk1);
db_free($zchk1);
$zchk2 = db_query("SELECT latitude,longitude
FROM z_data_zips WHERE zip=$vz");
list($vlat,$vlong) = db_rows($zchk2);
db_free($zchk2);
$distance =
number_format(ceil(69*rad2deg(acos(sin(deg2rad($ulat)) *
sin(deg2rad($vlat)) + cos(deg2rad($ulat
)) * cos(deg2rad($vlat)) * cos(deg2rad($ulong - $vlong));
echo "Distance from
you: $distance miles.\n";

}
db_free($uchk);
}


On 12/5/07, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> I'm entertaining how to determine what zip codes fall within a 50
> mile radius of another zip code.
>
> Anyone done this before?
>
> Also, does anyone have any sources for zip codes and lat/long databases?
>
> TIA for any help/suggestions.
>
> Cheers,
>
> tedd
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] zip codes and lat/longs

2007-12-05 Thread Bastien Koert

hate to say it,but there is lots on google like
 
http://www.code322.com/zipcode_locator.php
 
bastien> Date: Wed, 5 Dec 2007 20:58:52 -0500> To: php-general@lists.php.net> 
From: [EMAIL PROTECTED]> Subject: [PHP] zip codes and lat/longs> > Hi gang:> > 
I'm entertaining how to determine what zip codes fall within a 50 > mile radius 
of another zip code.> > Anyone done this before?> > Also, does anyone have any 
sources for zip codes and lat/long databases?> > TIA for any help/suggestions.> 
> Cheers,> > tedd> -- > ---> http://sperling.com http://ancientstones.com 
http://earthstones.com> > -- > PHP General Mailing List (http://www.php.net/)> 
To unsubscribe, visit: http://www.php.net/unsub.php> 
_
Discover new ways to stay in touch with Windows Live! Visit the City @ Live 
today!
http://getyourliveid.ca/?icid=LIVEIDENCA006

Re: [PHP] Zip Codes

2004-11-04 Thread Dusty Bin
Brian V Bonini wrote:
On Thu, 2004-11-04 at 12:47, Vail, Warren wrote:

If you can figure out how to make sense of this, you might be able to find
the point that a system is connected to the internet, by tracing back to a
visitors current IP address.

Which may get you close but either way would probably be more indicative
of the service providers location then the actual user and even
narrowing it down to a single city does not mean you have only a single
zip code to deal with.
not to mention DHCP!!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Zip Codes

2004-11-04 Thread Brian V Bonini
On Thu, 2004-11-04 at 12:47, Vail, Warren wrote:

> If you can figure out how to make sense of this, you might be able to find
> the point that a system is connected to the internet, by tracing back to a
> visitors current IP address.

Which may get you close but either way would probably be more indicative
of the service providers location then the actual user and even
narrowing it down to a single city does not mean you have only a single
zip code to deal with.

-- 

s/:-[(/]/:-)/g


BrianGnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org
aGEhIGJldCB5b3UgdGhpbmsgeW91IHByZXR0eSBzbGljayBmb3IgZmlndXJpbmcgb3V0I
GhvdyB0byBkZWNvZGUgdGhpcy4gVG9vIGJhZCBpdCBoYXMgbm8gc2VjcmV0IGluZm8gaW
4gaXQgaGV5Pwo=

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Zip Codes

2004-11-04 Thread Jay Blanchard
[snip]
> Thanks for the sarcasm, it definitely helps.
>
> Why is it that when people ask a question there is always someone that
has
> a smartass answer?
>

It keeps us on our toes. Someone's gotta do it.
[/snip]

It would be a terrible thing to arrive one day, open the list, and see
that everyone had been civil...no sarcasm, no witjust business. BTW
thanks for the heads up on that USPS API

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Zip Codes

2004-11-04 Thread Matthew Sims
> Thanks for the sarcasm, it definitely helps.
>
> Why is it that when people ask a question there is always someone that has
> a smartass answer?
>

It keeps us on our toes. Someone's gotta do it.

-- 
--Matthew Sims
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Zip Codes

2004-11-04 Thread Vail, Warren
Because for some of us, that part of our body is the smartest thing we have
going, and the rest of us is not engaged in the question.

Warren Vail

-Original Message-
From: bb9876 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:41 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Codes


Thanks for the sarcasm, it definitely helps.

Why is it that when people ask a question there is always someone that has a
smartass answer?

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thursday 04 November 2004 16:59, bb9876 wrote:
> > Is there any way to use PHP to determine the zip code someone is
visiting
> > from, assuming they are all from the US?
>
> Something like this should work:
>
> -- start
>  
> Please input zipcode  
>  
>
>if (!empty($_POST['zipcode'])) {
> echo "Whoa! your zipcode is {$_POST['zipcode']}";
>   }
> ?>
> -- end
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Thinking you know something is a sure way to blind yourself.
>   -- Frank Herbert, "Chapterhouse: Dune"
> */

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Zip Codes

2004-11-04 Thread Vail, Warren
One thing I might be tempted to try would be to execute a trace route
utility and analyze the output, but it is very cryptic;

http://www.traceroute.org/
http://www.tracert.com/cgi-bin/trace.pl

HOSTLOSS  RCVD SENTBEST AVG
WORST
er1.sfo1.speakeasy.net0%20   20   25.70   30.68
89.13
220.ge-0-1-0.cr2.sfo1.speakeasy.net   0%20   20   24.02   26.56
58.23
ge-4-0-440.ipcolo1.SanJose1.Level3.net0%20   20   24.38   25.28
27.09
ae-1-56.bbr2.SanJose1.Level3.net  0%20   20   24.26   31.00
97.58
so-3-0-0.mp1.SanFrancisco1.Level3.net 0%20   20   25.49   28.89
49.58
so-10-0.ipcolo1.SanFranciso1.Level3.net   0%20   20   25.17   25.81
26.73
gw-level3-sfo.internap.com0%20   20   27.32   28.12
29.58
border4.ge3-0-bbnet2.sfo.pnap.net 0%20   20   27.11   28.24
28.93
??? 100% 0   200.000.00
0.00

If you can figure out how to make sense of this, you might be able to find
the point that a system is connected to the internet, by tracing back to a
visitors current IP address.

If you come up with something useful, keep the list informed.

Warren Vail


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:22 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Codes


bb9876 wrote:
> Is there any way to use PHP to determine the zip code someone is 
> visiting from, assuming they are all from the US?
> 

Outside of asking the visitor for it, no.

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Zip Codes

2004-11-04 Thread bb9876
Thanks for the sarcasm, it definitely helps.

Why is it that when people ask a question there is always someone that has a
smartass answer?

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thursday 04 November 2004 16:59, bb9876 wrote:
> > Is there any way to use PHP to determine the zip code someone is
visiting
> > from, assuming they are all from the US?
>
> Something like this should work:
>
> -- start
> 
> Please input zipcode 
> 
> 
>
>if (!empty($_POST['zipcode'])) {
> echo "Whoa! your zipcode is {$_POST['zipcode']}";
>   }
> ?>
> -- end
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Thinking you know something is a sure way to blind yourself.
>   -- Frank Herbert, "Chapterhouse: Dune"
> */

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Zip Codes

2004-11-04 Thread Matthew Weier O'Phinney
* Bb9876 <[EMAIL PROTECTED]>:
> "John Nichel" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > bb9876 wrote:
> > > Is there any way to use PHP to determine the zip code someone is
> > > visiting
> > > from, assuming they are all from the US?
> > >
> >
> > Outside of asking the visitor for it, no.
> 
> Okay, I run a movie news site and wanted to use it to make it even
> quicker for users to find movie times in their area whether they were
> logged in or not, but that's the way it goes.

Well, you *could* have a form that displays asking for their zip code;
on submission, it sets a cookie with their zip code, and this allows
them to see their personalized movie times on subsequent visits. (You
could even hide the zipcode form if the cookie is set)

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Zip Codes

2004-11-04 Thread bb9876
Okay, I run a movie news site and wanted to use it to make it even quicker
for users to find movie times in their area whether they were logged in or
not, but that's the way it goes.

Thanks fo rthe replies.


"John Nichel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> bb9876 wrote:
> > Is there any way to use PHP to determine the zip code someone is
visiting
> > from, assuming they are all from the US?
> >
>
> Outside of asking the visitor for it, no.
>
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Zip Codes

2004-11-04 Thread Jason Wong
On Thursday 04 November 2004 16:59, bb9876 wrote:
> Is there any way to use PHP to determine the zip code someone is visiting
> from, assuming they are all from the US?

Something like this should work:

-- start

Please input zipcode 




-- end

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Thinking you know something is a sure way to blind yourself.
  -- Frank Herbert, "Chapterhouse: Dune"
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Zip Codes

2004-11-04 Thread John Nichel
bb9876 wrote:
Is there any way to use PHP to determine the zip code someone is visiting
from, assuming they are all from the US?
Outside of asking the visitor for it, no.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Zip Codes

2004-11-04 Thread Greg Donald
On Thu, 4 Nov 2004 08:59:50 -0800, bb9876 <[EMAIL PROTECTED]> wrote:
> Is there any way to use PHP to determine the zip code someone is visiting
> from, assuming they are all from the US?

http://www.usps.com/webtools/


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Zip Codes

2004-11-04 Thread Jay Blanchard
[snip]
Is there any way to use PHP to determine the zip code someone is
visiting
from, assuming they are all from the US?
[/snip]

You would have to determine their IP, which, some being dynamically
assigned at log on, would not necessarily indicate the users location.
Then you would have to be able to map the IP to a zip code. The short
answer is no.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Zip Codes

2004-11-04 Thread Vail, Warren
Do you mean other than asking them, like using their IP address?

Warren Vail

-Original Message-
From: bb9876 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Zip Codes


Is there any way to use PHP to determine the zip code someone is visiting
from, assuming they are all from the US?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php