0

Warning: Cannot modify header information - headers already sent by (output started at C:\php\xampp\htdocs\db_login.php:9) in C:\pear\pear\Auth\HTTP.php on line 455

Warning: Cannot modify header information - headers already sent by (output started at C:\php\xampp\htdocs\db_login.php:9) in C:\pear\pear\Auth\HTTP.php on line 456

Access Denied

<?php
// Using Auth_HTTP to limit access
require_once('db_login.php');
require_once("Auth/HTTP.php");
// We use the same connection string as the pear DB functions
$AuthOpts = array(
'dsn' => "mysql://$db_username:$db_password@$db_host/$db_database",
'table' => "users", // your table name
'usernamecol' => "username", // the table username column
'passwordcol' => "password", // the table password column
'cryptType' => "md5", // password encryption type
);
$authenticate = new Auth_HTTP("DB", $AuthOpts);
// 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()){
echo "Welcome back to our site ".$authenticate->username.".";
}
?>

Edited by cthoes: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by cthoes
0

Using Auth_HTTP to authenticate a user but
i face this error ...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.