Hi I am bit stuck, I want to return results from a mysql database when a user enters their town or postcode in for example below they enter in their town or post code and a list of area managers is displayed closest to their town or postcode along with their contact number Is that possible Thank you Ian
It would depend your your database table is structured and what data you have. You would need to do a check on how close each location is to the user after returning all the results.
If by "close" you mean geographically, you'll need the latitude and longitude of each manager in the database, since you'll need them to calculate "closeness". You'll also need a database of postcodes vs. lat/long to determine what the user's lat/long is. (You might be able to use Google for that, depending on the country you're located in.)
depends on your structure of tables... either you can store every place's name with near by place using latitude ... or you can also use google map for this purpose.
<?php $ip = $_SERVER['REMOTE_ADDR']; $api_key = "fa21adbc3ead7eda75b0192aa6b296e7ddba9a6e71c32018ae1938289241af58"; $data = file_get_contents("http://api.ipinfodb.com/v3/ip-city/?key='".$api_key."'&ip=74.125.45.100&format=json"); $country_code = json_decode($data); $code = $country_code->{'countryCode'}; echo '<img src="'.$code.'.jpg"/>'; ?>