Auth
| From: | Florian Hohenberger | Date: | Fri, 18 Jul 2003 10:03:28 +0000 |
| Subject: | Auth | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6664@lists.php.net to get a copy of this message | ||
I want to use a loginCallback and a logoutCallback function:
[code]
function writeLogin($f_username) {
global $user, $pass, $host, $db_name;
$sql = "INSERT INTO online VALUES ('".$f_username."','".time()."') ";
$dsn = "mysql://$user:$pass@$host/$db_name";
$db = DB::connect($dsn);
if (DB::isError($db)) {
die ($db->getDebugInfo());} $result = $db->query($sql); if (DB::isError($result)) {
die ($result->getDebugInfo());} } [/code] This works: $sql = INSERT INTO online VALUES ('the_username','1058529458') [code] function eraseLogin($f_username) { global $user, $pass, $host, $db_name; $sql = "DELETE FROM online WHERE o_id = '".$f_username."' "; $dsn = "mysql://$user:$pass@$host/$db_name"; $db = DB::connect($dsn); if (DB::isError($db)) {
die ($db->getDebugInfo());} $result = $db->query($sql); if (DB::isError($result)) {
die ($result->getDebugInfo());} } [/code] This doesn't work: $sql = DELETE FROM online WHERE o_id = '' - it does not receive the username /**
* Register a callback function to be called on user logout.
* The function will receive a single parameter, the username.
* ^^^^^^^^
* @access public
* @param string callback function name
* @return void
* @see setLoginCallback()
*/
function setLogoutCallback($logoutCallback)
I really can't figure out why this is not working - any help?
Best regards
Florian