PHP code example of rde / auth-basic

1. Go to this page and download the library: Download rde/auth-basic library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rde / auth-basic example snippets



// 建構一個 basic 驗證物件

$basic = new Rde\Auth\Basic(array(
    'user_name' => 'encode_password', // 請使用 password_hash
));

// 登入判斷

$basic->isAuthorized() or $basic->challenge();