|
Post by meerkat on May 22, 2020 16:19:54 GMT -5
I want to log web hits to my site. How do I get client information like browser, OS, and IP address. I was going to place a <iframe> in each root web page, and use PHP. Then log to a SQLite dated file so I can do statistics on date, who, what, oc, country etc..
I'm not sure how to do this is LB..
Thanks for the help.. Dan
|
|
|
Post by Chris Iverson on May 22, 2020 17:57:22 GMT -5
The PHP script would receive the IP address of the client, and ideally, the headers that the client sent. It could then log those. In particular, the UserAgent header is what contains the information on what browser is being used. You can check yours by going to whatsmyua.info. Here's mine on Chrome: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 On Firefox: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0 On Microsoft Edge: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 Edg/81.0.416.77 On Internet Explorer: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko See en.wikipedia.org/wiki/User_agent#Use_in_HTTP for more info, including why all of them of the name "Mozilla" in them. The PHP script can log those for each connection, and LB can parse the logs.
|
|
|
Post by meerkat on May 22, 2020 19:02:18 GMT -5
Thanks Chris, Looks good.. It should solve my problem. I'll give it a try..
Thanks again.. Dan
|
|
|
Post by meerkat on May 23, 2020 6:32:21 GMT -5
I decided to use Run Basic. I placed a link to the RB webHits project in a <iframe> of my web pages. The webHits program logs everything in a SQLite DB. I log the date,time,ip,browser,os,webApp Using the IP the webHits program gets all the detail about the client using: a$ = httpget$("http://ipinfo.io/"+ip$) It scrapes the data and logs the following additional info; areaCode city cityLatitude cityLongitude continentCode country countryCode ispNname localDate localTime metroCode organization postalCode region timeZone
Now I get stats on who, what, when, where. Interesting what I'm finding out about what's going on with my site..
Thanks for your help.. Dan
|
|