Page 1 of 1

Capture gps data using php

Posted: Tue Mar 01, 2011 11:00 am
by adityasinha
Hi ,
I want to capture the data being posted by a GPS device using PHP . The data being posted by the device is not having http headers and consist of a data which is like

>demo,13,19.256645,72.871895,1132.119995,|,19.256643,72.871902,1132.020020,0.157,0,10,0,255,255,255,47.9M,0.43,04B3,7383,0842,45,255,404,92,23,7383,1203,00,00,255<

I tried to capture this data using $_SERVER['REQUEST_METHOD']; but it returns nothing .

please find attached a java application which can be used to simulate the scenario . If i use a java based application i was able to get the device communication well both from the device as well as the attached java program.

I want to know how can i listen to the communication from the device using which method .

Thanks
Aditya

Re: Capture gps data using php

Posted: Tue Mar 01, 2011 11:24 am
by Jonah Bron
Can you make it have HTTP headers? If it doesn't, I don't think it qualifies as "post". POST is a part of the HTTP protocol. Otherwise you'll have to listen to the socket yourself.

Re: Capture gps data using php

Posted: Tue Mar 01, 2011 12:14 pm
by John Cartwright
Jonah Bron wrote:Can you make it have HTTP headers? If it doesn't, I don't think it qualifies as "post". POST is a part of the HTTP protocol. Otherwise you'll have to listen to the socket yourself.
Indeed. You either need to make a PHP daemon run in the background which creates a socket and listens on a specific port (besides port 80), otherwise have your java class create a properly formed HTTP request.