Pear Auth problem

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

 



Hello.
I am trying to use pear Auth packet but am doing something wrong.
I am currently looking at the simple example in the documentation, but
something is wrong in my source code, because if I write a username
and a password in the fields and hit the submit button, I receive a
blank pages without any informatio at all..

Here is my source code:
-----------------------------------

<?php

require_once('Auth.php');
if(!isset($_POST['submit'])){
function loginFunction($username = null, $status = null, &$auth = null){
?>

<form action="index.php" method="post">
	<fieldset>	
    <legend>Login:</legend>
	<p>
    <label for="username">Username:</label><br>
	<input id="username" name="username" type="text">
    </p>
    <p>
    <label for="password">Password:</label><br>
	<input id="password" name="password" type="password">
    </p>
    <p>
    <input id="submit" name="submit" type="submit" value="Login">
    </p>
    </fieldset>
</form>

<?php	
	}

	$options = array(
	'dsn' => "mysql://username:password@localhost/database",
	);
	$a = new Auth("DB", $options, "loginFunction");
	$a->start();
	
	if($a->checkAuth()){
		header("Location: http://www.karl-arne.name/";);
		}
} 	
?>

The example is located at:
http://pear.php.net/manual/en/package.authentication.auth.intro.php

Thanks for your time.
Karl

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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