PEAR app AUTH_HTTP

Source: Internet
Author: User

With AUTH_HTTP, you can easily build HTTP-based verification programs and specify user data tables as needed, which is easy to use...
Example:
<? Php
Require_once ("Auth/HTTP. php ");
$ Options = array (
Dsn => "mysql: // root: @ localhost/test", // database connection string
Table => "test_http", // User table
Usernamecol => "name", // username field
Passwordcol => "passwd", // User Password Field
CryptType => "md5", // password and password method
Db_fields => "*",
);
$ A = new Auth_HTTP ("DB", $ options );

$ A-> setRealm (yourrealm); // realm name
$ A-> setCancelText (Error 401); // message displayed when verification fails.
$ A-> start (); // starting the authentication process

If ($ a-> getAuth () // success
{
Echo "Hello $ a-> username welcome to my secret page ";
Echo $ a-> getAuthData (userid); // obtain other fields
Echo $ a-> getAuthData (telephone );//
Echo $ a-> getAuthData (email );

// Print_r ($ );
};
?>


Add this program before the program to be verified ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.