This topic is locked

Writing Variables to Database

10/25/2008 8:11:21 PM
PHPRunner General questions
W
wengen author

Hello,
We are migrating to a new LAMP server with PHP 4.49 & MySQL 4.2.
We have the following script set to load on successful login:
<?php
function AfterSuccessfulLogin()

{

//** Insert a record into another table and send email ****

global $username,$password,$conn;

$strSQL = "insert into Log (userid, password, ip, login_time) values ('" . $username . "','" . $password . "','" . $_SERVER['REMOTE_ADDR'] . "',now())";

db_exec($strSQL,$conn);
$email="blah@blah.com";

$message="User " . $username . " logged in";

$subject="Login notification";

mail($email, $subject, $message);
}
?>
This script worked fine on our old LAMP server, but now will only write "ip" & "login_time" to the Table: Log.
I was wondering if anyone has any ideas as to why $username & $password are not being captured and/or written to the database on our new server.
Thanks

Sergey Kornilov admin 10/28/2008

This doesn't look right.
Function header should look like this:

function AfterSuccessfulLogin($username, $password,&$data)