PHP Code Obtain Details About Visitors

The following PHP is used on my WordPress web site to obtain information about those visiting my web site:

Information includes:

A purple dot IP address
A purple dot City
A purple dot Country
A purple dot State
A purple dot Page visited
A purple dot Referer

Steps to follow are:

I should point out, although I designed this for Wordpress I no longer use that platform. This is due to design layout restrictions and huge amount of hackers looking for one of the many security vunerabilities in WP.

A purple dot Create a table in your database to store the data
A purple dot Get a free account from ipinfo.io and they will give you a KEY
A purple dot Edit the code below placing your database name and table names into it
A purple dot Also place in the secret key for ipinfo.io
A purple dot place the code into a [Short Code] editor

I use: “Insert PHP Code Snippet” By xyzscripts.com
Than, insert the short code into all of your web page you want to gather statistics on the visitors.
For myself, I place the short code at the bottom of each page I want monitored for purpose of gathering statistics.

The PHP code:


Grid Status:    Grid is online
Members:   32
Online last 30 days   10
Online past 24 hours   8
Unique hypergrid visitors   74

 

 

Web design and created by:  Jeffrey Dougall ©2024