PURDooM's PHP GPS tracker
v 0.1 beta
In order to use this, you need a web server which supports php and mysql, and basic knowledge on how to use it (googleable). On your server, make a database, then make a table named tracker with the command:
CREATE TABLE `tracker` (
`lat` float(15,10) default NULL,
`lng` float(15,10) default NULL,
`speed` int(11) NOT NULL,
`time` datetime default '0000-00-00 00:00:00',
`id` int(11) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
On your server, copy the contents of the 'server' directory wherever you want to use it.
Go to google maps api at
http://www.google.com/apis/maps/ , and get an api key for the directory
you use for your tracker (example
http://www.mywebpage.com/tracker).
Open trackcarheader.inc and put the api key sorrounded in quotes on the line that says $googleapi.
Edit $username, $password, $hostname, and $database to contain the appropriate settings to access mysql.
Put in a name for your car under $carname.
Put in a semi secret password for $badrangepass - this is what you will give to people who you trust
to know where your car is when it is at important locations, like home, school, or work.
If you wish, specify some bad ranges for lat and long numbers where you don't want strangers to know
where your car is. The format is:
$badrange = array('range1', 'range2', 'range3', ect...);
for each range, specify a minimum longitude and latitude, a maximum longitude and latitude, and a 1 word name for each range. You can find the ranges by centering google maps on the point, pressing link to this page, and copying the numbers after ll= in the url at the top of the page.
Next, put the contents of 'client' on your carpc, and edit the config. It looks like:
Upload Url:
http://www.mywebsite.com/gpstracker.php
Com port:
9
Frequency (miliseconds):
10000
Put the URL of the tracker web page on the 2nd line, com port on the 4th, and the frequency on the 6th (in miliseconds).
Make it start on startup somehow (startup folder?)
Run the program. If all goes well, you should be able to access the web page trackerview.php and see where the car is. If all doesn't go well, ask the forums.
If this works, its a minor miracle! I made this in only about 4 hours.