Jump to content

Recommended Posts

Is there a way for me to get the users current zip code of where they are with their laptop, or desktop?

 

So, say I am in a Starbucks in the zip code: 12345

 

When you go to my site and do a search for surrounding areas, it would automatically fill the zip code box with 12345

 

How can this be done?

Link to comment
https://forums.phpfreaks.com/topic/197136-get-zipcode/
Share on other sites

The IP provided by the ISP will not be your curent location. In fact my IP locates to London UK which is over 200 miles away.

So, this is not a viable solution to the question.

 

Yes it is, as it is the only possible method to automatically detect the zip code. As areas other than UK seldom have frame servers more than ~2-20Mi away, then the Zip code should be within a fair accuracy, if not completely correct.

Link to comment
https://forums.phpfreaks.com/topic/197136-get-zipcode/#findComment-1034989
Share on other sites

Yes it is, as it is the only possible method to automatically detect the zip code. As areas other than UK seldom have frame servers more than ~2-20Mi away, then the Zip code should be within a fair accuracy, if not completely correct.

True, it'll give you a fair .. and probably accurate position to begin a radial search from, but that's just it.. you would have to perform a radial search from that point, get all the zipcodes within X miles (in which X is unknown).. and guess logically (somehow) from the responses.

 

 

That's pretty much.. a "half-assed" accurate.  And something half-assed is never something to rely on.

Link to comment
https://forums.phpfreaks.com/topic/197136-get-zipcode/#findComment-1034995
Share on other sites

You see this thing used all the time on like cheap ass dating sites in the uk. It'll say things like 'meet the perfect girl in Bristol'. I'm no where fuc**** near Bristol for god sake, and not that I use dating sites, just had to make a few for clients.

Link to comment
https://forums.phpfreaks.com/topic/197136-get-zipcode/#findComment-1035006
Share on other sites

Surprisingly, this place is pretty accurate

http://www.hostip.info/

 

Off by about 10-20 miles

 

Location: ... actually we haven't a clue.

 

I found this:

http://www.maxmind.com/app/locate_demo_ip

 

and here is the dl page:

http://www.maxmind.com/app/geoip_country

Link to comment
https://forums.phpfreaks.com/topic/197136-get-zipcode/#findComment-1035056
Share on other sites

If you want a recordset and not a poor calculation based off of where a last user was seen with the IP, then something such as Maxmind GeoIP's pro database will provide something like, 97-99.7% accuracy? But their free one (along with a few other GeoIP services) should be sufficient enough, there's no need for such a strong solution to replace what a user should do.

 

The "Find at date at xxx" thing is ironically funny, first time I saw it, it was like "Oh, clever!" But then again maybe people would be willing to visit ONE city over for.... Well, lets leave it at there :P

 

 

Link to comment
https://forums.phpfreaks.com/topic/197136-get-zipcode/#findComment-1035058
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.