Home > Backend Development > PHP Tutorial > http://zikao.hneao.cn/net/ php auth_http class library for identity verification

http://zikao.hneao.cn/net/ php auth_http class library for identity verification

WBOY
Release: 2016-07-29 08:39:36
Original
1260 people have browsed it

Copy the code The code is as follows:


require_once("Auth/HTTP.php");
//Set the database connection options
$auth_opti
'dsn'=>"mysql: //root:1981427@localhost/test", //Database connection string
'table'=>"tablename1", //Table name
'usernamecol'=>"username", //Used to store username Column
'passwordcol'=>"password", //Column used to store passwords
'cryptType'=>"none", //Password encryption method
);
//Create Auth_HTTP object, specify DB As a source of information
$auth = new Auth_HTTP("DB", $auth_options);
//Description information on the settings dialog box
$auth->setRealm('Login');
//Identity verification failed or user Error message when canceling
$auth->setCancelText('Identity verification failed!');
//Start user identity verification
$auth->start();
//If identity verification is successful, Display information
if($auth->getAuth())
{
echo "Identity verification successful, welcome". $auth->username;
};
?>

The above introduces the http://zikao.hneao.cn/net/ php auth_http class library for identity verification, including the content of http://zikao.hneao.cn/net/. I hope that friends who are interested in PHP tutorials Helps.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template