0

I am currently obtaining geolocation based on gps of device using JavaScript. Problem is that I need to use the location information in my PHP code. My work around is forwarding the geolocation request to a different page that includes the JavaScript and then posting the location data back via a form.

This is slow and there has to be a faster way.

Any ideas?

tyler
  • 1,273
  • 2
  • 16
  • 40

1 Answers1

1

You might want to embed the js call with some image tag or ajax based method to directly post it php code .. or perhaps set some cookie for further processing..

For next request your php code will already have the geo loaction.

Scalable
  • 1,550
  • 4
  • 16
  • 29