PEAR::Auth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Concerning PEAR::Auth

I can't tune interaction between PEAR::Auth and MySQL.

 

Typical code

<?php

$dbtype  = 'mysql';

$dbhost = 'localhost';

$dbuser = '';

$dbpass = '';

$dbname = "cosmos";

$dsn = "$dbtype://$dbuser:$dbpass@$dbhost/$dbname";

$conn = mysql_connect($dbhost, $dbuser, $dbpass);

mysql_select_db($dbname);

require_once "Auth/Auth.php";

function loginFunction(){

    echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\">";

    echo "<input type=\"text\" name=\"username\">";

    echo "<input type=\"password\" name=\"password\">";

    echo "<input type=\"submit\">";

    echo "</form>";

}

$a = new Auth("DB", $dsn, "loginFunction");

$a->start();

if ($a->getAuth()){

    echo "OK";

}

?>

 

With typical  SQL statement:

CREATE TABLE auth(
username VARCHAR(50) default '' NOT NULL,
password VARCHAR(32) default '' NOT NULL,
PRIMARY KEY (username),
KEY (password));

 

I tried:

INSERT INTO auth VALUES ('qq', 'pp');

 

after submitting the login form the process buzzes on the procedure start();

I tried too:

INSERT INTO auth VALUES ('qq', PASSWORD('pp'));

 

I tried (using phpMyAdmin):

GRANT SELECT ,  INSERT , UPDATE , DELETE , CREATE , INDEX , ALTER ON * . * 

TO "qq"@ localhost" WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ;

 

But process buzzes on the procedure start() as before;

How to set username and password?

 

 

 

Vlad Alivanov

 

 

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux