Jump to content

Pear Login Fails


matt2385

Recommended Posts

I am using the newest version of PEAR Auth.  The login I created worked, it logs in and displays the user id from the table from the object. When I try to navigate to the link on page1, I get a MDB2 Error: not found. I am currently running everything off a shared host which runs pear from a directory. Here is my login page.

 

 

<?php

include 'Auth/Auth.php';

 

function loginFunction($username = null, $status = null, &$auth = null)

{

/*

* Change the HTML output so that it fits to your

* application.

*/

echo "<form method=\"post\" action=\"page1.php\">";

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

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

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

echo "</form>";

}

 

$a = &new Auth('MDB2', $loginOptions,'loginFunction');

$a->start();

 

if (!$a->checkAuth()) {

echo 'not authorized - exiting' . '<br />';

exit();

}

?>

 

Page1.php

 

<?php

 

require_once dirname(__FILE__).'/login.php';

 

echo $a->getUserId();

 

?>

<html>

<head>

</head>

<body>

<a href="<?php echo $url;?>/page1.php">Home</a>

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/251739-pear-login-fails/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.