I need to track logins and whether they are successful or not
I added an insert query just before the $Authenticate->execute() on my login page and it inserts into a login table the username, time and ISP of the person loggin in.
I wanted to test for a successful login and record that as well. Here's the code I added but I've not quite got it right because it always shows as successful even when I fail.
$InsertQuery = new WA_MySQLi_Query($eee);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "logins";
$InsertQuery->bindColumn("loguser", "s", "".((isset($_POST["user"]))?$_POST["user"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("logisp", "s", "". $_SERVER['REMOTE_ADDR']."", "WA_DEFAULT");
if ($SuccessRedirect) {
$InsertQuery->bindColumn("success", "i", "". 1 ."", "WA_DEFAULT");
} else {
$InsertQuery->bindColumn("success", "i", "". 0 ."", "WA_DEFAULT");
}
$InsertQuery->saveInSession("login");
$InsertQuery->execute();
What am I doing wrong?