I have asked this question earlier, but could not get a reply that
worked :-(
I have a single login_success.php file where I have written a function
IsWithinFixedGeofence(point)
{
......
....
...
if ( distance <= MINIMUMDISTANCE )
{
return PointsOfInterest[i];
}
I want to be able to store the following three properties of
PointsOfInterest. I am not sure if I need the command "return" as
well. All I want to do is store:
1) index i
2) .lat
3) .lng
into 3 PHP variables.
something like -
IsWithinFixedGeofence(point)
{
...
..
if ( distance <= MINIMUMDISTANCE )
{
<? $lat ?> = PointsOfInterest[i].lat;
<? $lng ?> = PointsOfInterest[i].lng;
<? $index ?> = i;
}
and then be able to use $lat, $lng to center the map to that point.
// Display the map, with some controls and set the initial location
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.setCenter(new GLatLng(<? $lat ?>, <? $lng ?>),15);
and use the index in a dynamic SQL query like this -
$result = mysql_query("SELECT cities.cityname, cities.citybuslink,
markers.information, markers.name, markers.address , markers.picture
FROM cities, markers where markerid = <? $index ?> AND markers.cityid =
cities.cityid ");
Do I really need to store the JS function return value into PHP variables or can I use the function IsWithinFixedGeofence()'s return value as a source everywhere else too ?
Something like
IsWithinFixedGeofence().lat
IswithinFixedGeofence().lng
and
IsWithinFixedGeofence().index
I heard AJAX would also work with something like this, but I am not
sure how to use it in this context..
I would be extremely grateful if you could help me with this
problem.
Best regards,
Amol