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>