This topic is locked

Audit Log

1/23/2006 12:23:51 PM
PHPRunner General questions
S
sloftus author

I followed the instructions using global event to add username, ip and date to a table "Login log"when a user successfully logs in. However I find sometimes I get duplicate entries in the log table. Do you have any ideas? the code I am using is the same as your example script in a previous post with slight field name changes.
function AfterSuccessfulLogin()

{

//** Insert a record into another table ****

global $conn;

$Username = @$_SESSION["UserID"];

$IP = $_SERVER["REMOTE_ADDR"];

$strSQLInsert = "insert into `Login log` (Username, IP, datetime) values ('$Username', '$IP', NOW())";

db_exec($strSQLInsert,$conn);
}
Can you help. Thanks.

Sergey Kornilov admin 1/24/2006

Hi,
this code can not produce duplicate records in Log table.
You can zip and send me the full set of generated PHP pages, your database creations script and instructions on how to reproduce the error.

I'll try to find what's wrong running your pages on my test box.

A
amirgulamali 8/23/2006

Hi sergey,

Lofty is right, i am using a similar code and it enters records twice for a single login... any solution?

A
amirgulamali 8/23/2006

nevermind, it entered records twice on my local machine but when uploaded the pages on my web server, it worked just fine.. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=10615&image=1&table=forumreplies' class='bbcemoticon' alt='<<' />