Post Visit CounterWith Ip |
does anyone knows how to implement an IP based view counter when someone clicks my posts? how do we make this in ci4 thank you
1) Create a database page_visits table.
2) Use CodeIgniters incoming request class to get the users IP address. 3) Check database to see if the IP exists. 4) If the IP exists then increment counter and save to database What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Something like this:
PHP Code: $ipTableModel = new App\Models\IpTableModel();
(01-17-2021, 03:44 PM)thedragon655 Wrote: does anyone knows how to implement an IP based view counter when someone clicks my posts? how do we make this in ci4 thank youthe code needs get user location use _helper ci4 then call funtion in controller all you need PHP Code: function getCountryByIp($ip)
Enlightenment Is Freedom
|
Welcome Guest, Not a member yet? Register Sign In |