how to store successful logins
I have a site which uses security assist as a basis or its login page.
the login page checks the members table and on authentication, the members is permitted site access
i wish to store successful logins in a separate table so i can see how often particular members access the site.
so far this has been quite straightforward, and the login form and the insert works well
<?php
if(isset($_POST["LogIn"])){
$WA_Auth_Parameter = array(
"connection" => $mysqli,
"database" => $database_mysqli,
"tableName" => "tblmembers",
"columns" => explode($WA_Auth_Separator,"MemberEmail".$WA_Auth_Separator."MemberPassword"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["emailaddress"]))?$_POST["emailaddress"]:"") ."".$WA_Auth_Separator."".sha1(((isset($_POST["userpassword"]))?$_POST["userpassword"]:"")) .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"MemberID".$WA_Auth_Separator."userLevel"),
"sessionNames" => explode($WA_Auth_Separator,"MemberID".$WA_Auth_Separator."userLevel"),
"successRedirect" => "",
//"successRedirect" => "/index.php",
"failRedirect" => "",
"gotoPreviousURL" => FALSE,
"keepQueryString" => TRUE
);
WA_AuthenticateUser($WA_Auth_Parameter);
//print_r($WA_Auth_Parameter);
}
?>
<?php
if((isset($_POST["LogIn"])) && (WA_Auth_RulePasses("Admins and members"))) { // login success
//print_r('hello');
//if(""=="") {
$InsertQuery = new WA_MySQLi_Query($mysqli);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "tbllogin";
$InsertQuery->bindColumn("MemberID", "i", "".$_SESSION['MemberID'] ."", "WA_DEFAULT");
$InsertQuery->saveInSession("LoginID");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
However the problem i have is as follows...
if i use the login form with login.php as the url, both blocks of code execute and the login table is populated
if i have been redirected to the login form from say the index page which has restricted access, the url will read /login.php?accesscheck=%2Findex.php%3F
if i complete the login form here, the insert block does not run.
i tries setting gotoPreviousURL to false, but it doesn't seem to make any difference