Warning: require_once(Auth/HTTP.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\OReilly\login.php on line 10
Fatal error: require_once() [function.require]: Failed opening required 'Auth/HTTP.php' (include_path='.;C:\xampp\smarty\libs') in C:\xampp\htdocs\OReilly\login.php on line 10
Am having trouble using PEAR packages with smarty. Everything was working fine with pear and its packages. However, when i installed smarty for my templates, i started getting errors in my scripts like 'headers already send by [path]....'.
Is there a way to make smarty and PEAR packages work together. I managed to configure the 'php.ini' file so that my templates in smarty load in the browser.
Here's my code;
- Code: Select all
<?php
#Auth_HTTP returns additional information about the user
//include login details
require_once('db_login.php');
//include header templates page
require_once('config.php');
//include authentication page
require_once("Auth.php");
// We use the same connection string as the pear DB functions
$AuthOptions = array(
'dsn' =>"mysql://$db_username:$db_password@$db_hostname/$db_database",
'table' => "users",//table name
'uernamecol' => "username", //table username column
'password' => "password", //table password column
'crypttype' => "md5", //password encryption type in db
'db_fields' =>"*" //enabling fetch for other db columns
);
$authenticate = new Auth_HTTP("DB", $AuthOptions);
// set the realm name
$authenticate->setRealm('Member Area');
// authentication failed error message
$authenticate->setCancelText('<h2>Access Denied</h2>');
// request authentication
$authenticate->start( );
// compare username and password to stored values
if ($authenticate->getAuth( ))
{
session_start( );
$smarty->assign('blog_title',$blog_title);
$smarty->display('header.tpl');
//setup session variable
$_SESSION['username'] = $authenticate->username;
$_SESSION['first_name'] = $authenticate->getAuthData('first_name');
$_SESSION['last_name'] = $authenticate->getAuthData('last_name');
$_SESSION['user_id'] = $authenticate->getAuthData('user_id');
echo "Login successful. Great to see you ";
echo $authenticate->getAuthData('first_name');
echo " ";
echo $authenticate->getAuthData('last_name').".<br />";
$smarty->display('footer.tpl');
}
?>
Help pliz