Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-15-2013, 04:40 PM   PM User | #1
a4udi
Regular Coder

 
Join Date: Jan 2005
Posts: 181
Thanks: 5
Thanked 0 Times in 0 Posts
a4udi is an unknown quantity at this point
Sorting users by Location

I'm not even sure where to begin with this, but maybe someone can point me in the right direction. Our website has a number of registered users who fill out their location "city/country" and we have a "Members" page that lists everyone. What we would like to do is simply sort this list so that if you login from "Nashville, TN" it will show you other users from there, and then from nearby locations/cities...

How exactly would one go about doing this... do we need to capture IP addresses and then reference somehow??
a4udi is offline   Reply With Quote
Old 02-16-2013, 05:51 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,382
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
Quote:
fill out their location "city/country"
Kinda says your in Europe. In which case you should have a state column for people from the USA. Then to find people close to a new registered user search for city or country and display them as really close people. If you do the state, you can search on that, exclude the city and display as not so close and alphabetize. If you want to list by distance you will need to get Lon/Lat for every location and do Math.

FYI: My IP puts me 250 miles away from where I really am.
sunfighter is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:09 PM.


Advertisement
Log in to turn off these ads.