开发者

Is it possible to access the NMEA information of the devices using PHP?

开发者 https://www.devze.com 2023-02-22 06:18 出处:网络
Hi How can we get the NMEA data of the device using PHP so it can be use to identify its location using WEB that don\'t have javascript turned on.I know HTML 5 geolocation can be use to gather the loc

Hi How can we get the NMEA data of the device using PHP so it can be use to identify its location using WEB that don't have javascript turned on.I know HTML 5 geolocation can be use to gather the location but it is limited to other mobile without with javascript turned off. The skyhook provides also an API for gathering the location but it needs to use a javascript which can 开发者_StackOverflow社区be turned off by a user.


How can we get the NMEA data of the device using PHP so it can be use to identify its location using WEB that don't have javascript turned o

PHP runs on the server, not the client. PHP has zero access to the hardware on the client's machine. This is not a task you will achieve with PHP alone.

The only way for PHP to gain access to this information is if the client sends it. The best and most reliable way for a client to send geolocation data to PHP right now -- outside of custom software designed for the GPS in question that you would need to design and have the client install -- is Javascript.

So what if users turn Javascript off, or disable the geolocation features in their browser! This simply means that they won't be able to use the parts of your application that require geolocation. If that happens to be the only thing your application has going for it, then they're probably better off not using it, right?


You could look if there's a Java applet or a ActiveX control which can do this for you, but I guess there aren't any. To my knowledge the only way of geolocation is through the HTML5 geolocation API (or the deprecated Google Gears Geolocation). And we should be glad that's the only way, I don't like website snooping on my location ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消