I'm trying to find a way to design a system which logs users actions on and around the site. Right now I'm trying to log just three things, but this could expand: registration, login, and submitting the one form on the site. With all of them I'm recording ip, user id, and time. Now where I'm stuck at is that I need to log what the user submits with the form. I originally created a column in the datbase called 'extra' and just stored a serialized array of the form data there. I realize now this won't work as I later need to work with this logged form data (selecting all users who put in certain data for example).
The code to log the user signing up, for example:
$log->action(array('action' => ACT_SIGNUP,
'user_id' => $db->lastInsertId()
)
);
Thanks!