最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ajax - Tracking Visitor LatLng with Wordpress using JS, PHP. How to put data which was extract using JS into DB

programmeradmin1浏览0评论

Case: I tried to implement via js a geolocation tracker (not an IP Tracker). The code snippet is under Divi > Integration > Body Tag (Divi Page Builder). Afterwars i build via PhpMyAdmin a table which colums i need like visitor_id, visitor_lat, visitor_lng etc.

Question: How do i put the data i get via my js snippet into my data base table gps_tracker?

What i know: I know that i have to use some php to put some data into my db. I read about ajax, jquery and so on but got confused, which to choose.

Question 2: Lets say i have the php code to put the gps location into my table, where to i write the php code, in the child theme functions.php or in a separate file where i upload later to my host?

One of many Goals: In the end i want to build a map, which visitor location shows up and my truck location. So i can calculate the distance in minutes. So the visitor would know i will be in 20 minutes in his place.

Tried to build something like this:

But like mentioned, do not really know where place the code. Maybe creating and uploading the files in WEBFTP?

Also it would be really nice, if someone can give advice how to start with php progamming regards wordpress, especially, retrieving data and putting data into DB.

Regards,

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论