As I see you are already familiar with the geolocation filters provided by solr.
So what is your problem here? Do you already provide the geolocation when you index your data?
If not you should consider an API giving you geolocations for an given address so you can index it along your other data. See here
Then at search time to get the location of the person currently visiting your website check this out: HTML5 Location. As a failover you can fetch the approximate position of the person by using IP resolving APIs like this one: IP Resolver (There are others you can use if you search the web a little)
I hope this answers your question.
Edit: after your last post.
As I said before you get the location using the HTML5 location.
First you could add two hidden fields to your html form (I use jquery syntax):
//The form you use for the submission of your search query
<form action="search.php" method="post">
//Here are your form elements below are the hidden fields.
<input type="hidden" name="long" value=""/>
<input type="hidden" name="lat" value=""/>
</form>
<script type="text/javascript">
//Getting the location once the page finished loading
$( document ).ready(
function()
{
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(showPosition);
}
});
//Location callback. We set the long and lat values of the hidden fields.
function showPosition(position)
{
$('[name="lat"]').val(position.coords.latitude);
$('[name="long"]').val(position.coords.longitude);
}
</script>
Now the form was submitted we need to access the values we set at the hidden fields.
//The form was submitted so in your form submission handling code:
$long = $_POST["long"];
$lat= $_POST["lat"];
//Now you have your variables. You can now put them inside your query
//DO your query
Hope this helps.