Home > Backend Development > PHP Tutorial > PEAR application AUTH_HTTP_PHP tutorial

PEAR application AUTH_HTTP_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:36:52
Original
1215 people have browsed it

Using AUTH_HTTP, you can easily build programs based on HTTP authentication, and you can freely specify user data tables, which is simple and easy to use...
Example:
require_once("Auth/HTTP.php");
$options = array(
dsn=>"mysql://root:@localhost/test", //Database connection string
table= & gt; "test_http", // User table
usernamecol = & gt; "name", // user name field
passwordcol = & gt; "passwd", // User password field
crypttype = & gt; " md5",                                                                                                                                                                                           
$a->setRealm(yourrealm); // realm name
$a->setCancelText(Error 401); // Prompt message when verification fails
$a->start() ;                                                                        

if($a->getAuth()) // Success

{
echo "Hello $a->username welcome to my secret page";
echo $a->getAuthData (userid); // Get other fields

echo $a->getAuthData(telephone); //

echo $a->getAuthData(email);

//print_r($a);
};
?>

Add this program before the program to be verified..


http://www.bkjia.com/PHPjc/486623.html

www.bkjia.com

truehttp: //www.bkjia.com/PHPjc/486623.htmlTechArticleUsing AUTH_HTTP, you can easily build a program based on HTTP authentication, and you can freely specify the user data table, which is simple to operate. Easy to use... Example: ?php require_once("Auth/HTTP.php"); $options...
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
Latest Issues
Pear installation in Windows XAMPP PHP 8.1.10
From 1970-01-01 08:00:00
0
0
0
Pear Admin Think ​How the menu traverses data
From 1970-01-01 08:00:00
0
0
0
PhpUnit 9 fails on php 8+
From 1970-01-01 08:00:00
0
0
0
PHP fatal error cannot open required file
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template