Page 1 of 1

Login object

Posted: Fri Dec 01, 2017 8:56 pm
by alex4orly
I am using the Login object, but want to add a counter to record each time a visitor logs into the site.
I am storing the data in the .csv file
Any suggestions?

Cheers

Re: Login object

Posted: Fri Dec 01, 2017 9:22 pm
by BaconFries
It could be done by grabbing/collecting the IP of the visitor. Now not sure if this would be possible for you to do, as I remember the visitors are mainly from your community (village) and the IP address is the same for all. If you looking to catch external visitors then maybe the following:
PHP Counter If you are then wanting to catch and save to a CSV then if may need a custom script for this. On another note isn't the visitors login details saved to the CSV? and can't it then be simply counted to see who and how many times they have.?

Re: Login object

Posted: Fri Dec 01, 2017 10:09 pm
by alex4orly
Good memory Baconfries...

When a visitor logs in, it gives me their villa number as "User name" so I already capture who they are, no need for their IP address which in my case as you said is usless. I want the individual count for each, not the global number of visitors.

I can redirect the person once his / her login is succesful to the "Success page" and in there write some PHP script to do the counting. BUT
1) I have no idea how to capture the user name / villa number from the original WWB Login object to pass it ont the success page
2) Once I can do that, I will have to open the saved visitors.csv and seek that particula record
3) Once found, read the latest counter and increment it by 1

Any suggestions?

Re: Login object

Posted: Fri Dec 01, 2017 11:37 pm
by BaconFries
Would need to use "Group by" and COUNT(*) from your SQL database if using one. See the following
User Per Day

Re: Login object

Posted: Sat Dec 02, 2017 3:58 am
by alex4orly
Not the case, just using a CSV flat file.
Will have to read the record, increment and save back

Thanks