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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.