Sample project Realtime GPS Tracking menggunakan PHP + MySQL Database dan jQuery (update data secara realtime). Project ini menggunakan lib map yang telah dimodifikasi oleh PubNub.
- XAMPP or any Apache webserver
- phpMyAdmin (included if you used XAMPP)
- PubNub Key (publish and subscribe key), register here for free http://www.pubnub.com/get-started/
Download this repo and store, if you're using windows and XAMPP installed, path are available in
C:\xampp\htdocs\
Put master-app folder in there, like
C:\xampp\htdocs\realtime-gps-tracking\
Create database named realtime-gps-tracking. Sample db are available in this directory, just import it.
/sample db/realtime-gps-tracking.sql
Create database connection string, file already koneksi.php.
<?php
$host="localhost";
$username="root";
$passwd="";
$db_name="realtime-gps-tracking";
$connection = mysqli_connect($host,$username,$passwd,$db_name) or die("Error " . mysqli_error($connection));
?>
Put and change that demo key to your PubNub key.
var pubnub = new PubNub({
publishKey: 'demo', //put your PubNub publish key
subscribeKey: 'demo' //put your PubNub subscribe key
});
Blue marker getting data from db.
Blue marker will moved without refreshing the page, gotcha! track! :D
GNU General Public License v3.0