I wish to create a log in system where every time a user logs in, this activity is logged in another table. How is this possible?
I am using PHP and MySQL, I have an ok knowledge of the two and currently have a system that I have designed using various tutorials.
It is very simple as that is all I require at the moment however I may look to streamline the code at a later date by making it object oriented however this is above my skill level at this time.
The user registers with their name, username, password and email. The user is then emailed their log in details - what I would like is for the user to have to click a link in within the email lot activate their account.*1
Once the user has activated their account the user logs in with a username and password - I would like their 'activity' to be stored, i.e the date/time that they log in.*2
*1: Currently, when the user registers, they receive an email with their log in details, I would like the email to contain a link so that they can 'activate' their account. How can I implement this. I know that I should store a unique code in the database but I do not know how to send that information to the user and to check it against the database.
*2: I would like the date and time stored in a table when the user logs in, so that their 'activity history' can be checked. How do I go about this. I know that I need to create a new table called something like 'log' which merely stores the username and date, but I do not know how to populate it when the user logs in.
If anyone can help that's be more than appreciated.