Hey yall,
i work with xampp php/mysql.
this is about a login routine via PEAR Auth.
please take a look at my short php script.
the problem: i run more than 1 databases. and i don't know how and where to connect my check-routine to one of these.
my db_login.php connects me successfully to "localhost". but how do i tell the system what database to read from?
<?php
require_once('db_login.php');
require_once("Auth/Auth.php");
$AuthOpts = array('dsn' => "mysql://$db_username:$db_password@$db_host/$db_database",
'table' => "users",
'usernamecol' => "username",
'passwordcol' => "password",
'cryptType' => "md5"
);
$authenticate = new Auth("DB", $AuthOpts);
$authenticate->start( );
if ($authenticate->getAuth( )){
echo "Welcome back ".$authenticate->username.".";
}
?>