Hướng dẫn how do i authenticate in php? - làm cách nào để xác thực bằng php?

Có thể sử dụng hàm Header () để gửi thông báo "Authentication Required" đến trình duyệt khách khiến nó bật lên cửa sổ đầu vào tên người dùng/mật khẩu. Khi người dùng đã điền tên người dùng và mật khẩu, URL chứa tập lệnh PHP sẽ được gọi lại với các biến được xác định trước PHP_AUTH_USER, PHP_AUTH_PW và AUTH_TYPE được đặt thành tên người dùng, mật khẩu và loại xác thực. Các biến được xác định trước này được tìm thấy trong mảng $ _Server. Chỉ các phương thức xác thực "cơ bản" và "tiêu hóa" mới được hỗ trợ. Xem hàm tiêu đề () để biết thêm thông tin.header() function to send an "Authentication Required" message to the client browser causing it to pop up a Username/Password input window. Once the user has filled in a username and a password, the URL containing the PHP script will be called again with the predefined variables PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE set to the user name, password and authentication type respectively. These predefined variables are found in the $_SERVER array. Only "Basic" and "Digest" authentication methods are supported. See the header() function for more information.

Một đoạn kịch bản ví dụ sẽ buộc xác thực máy khách trên một trang như sau:

Ví dụ #1 ví dụ xác thực HTTP cơ bản

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>

Ví dụ #2 DIGEST HTTP Xác thực ví dụ

Ví dụ này chỉ cho bạn cách thực hiện tập lệnh xác thực HTTP tiêu hóa đơn giản. Để biết thêm thông tin, hãy đọc »& nbsp; RFC 2617.

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');

if (empty(

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>

Lưu ý: Lưu ý tương thích: Compatibility Note

Hãy cẩn thận khi mã hóa các dòng tiêu đề HTTP. Để đảm bảo khả năng tương thích tối đa với tất cả các máy khách, từ khóa "cơ bản" phải được viết bằng chữ hoa "B", chuỗi cõi phải được đặt trong các trích dẫn kép (không đơn) và chính xác một không gian phải đi trước mã 401 trong HTTP/1.0 401 Dòng tiêu đề. Các tham số xác thực phải được phân tách bằng dấu phẩy như trong ví dụ tiêu hóa ở trên.

Thay vì chỉ đơn giản là in ra PHP_AUTH_USER và PHP_AUTH_PW, như được thực hiện trong ví dụ trên, bạn có thể muốn kiểm tra tên người dùng và mật khẩu cho tính hợp lệ. Có lẽ bằng cách gửi một truy vấn đến cơ sở dữ liệu hoặc bằng cách tìm kiếm người dùng trong tệp DBM.

Xem ra cho trình duyệt trình duyệt internet explorer ngoài kia. Họ có vẻ rất kén chọn về thứ tự của các tiêu đề. Gửi tiêu đề xác thực www trước khi tiêu đề HTTP/1.0 401 dường như thực hiện thủ thuật cho bây giờ.

Lưu ý: LƯU Ý Cấu hình: Configuration Note

PHP sử dụng sự hiện diện của chỉ thị AuthType để xác định xem xác thực bên ngoài có hiệu lực hay không.

Tuy nhiên, lưu ý rằng những điều trên không ngăn cản ai đó kiểm soát URL không xác nhận đánh cắp mật khẩu từ các URL được xác thực trên cùng một máy chủ.

Cả NetScape Navigator và Internet Explorer sẽ xóa bộ đệm xác thực của cửa sổ trình duyệt cục bộ cho vương quốc khi nhận được phản hồi máy chủ là 401. Điều này có thể "đăng xuất" một người dùng một cách hiệu quả, buộc họ phải nhập lại tên người dùng và mật khẩu của họ. Một số người sử dụng thông tin này để đăng nhập "hết thời gian" hoặc cung cấp nút "Đăng xuất".

Ví dụ #3 ví dụ xác thực HTTP buộc một tên/mật khẩu mới

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}

 if (!isset(

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n"
;
}
?>

Hành vi này không được yêu cầu bởi tiêu chuẩn xác thực if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
0, vì vậy bạn không bao giờ nên phụ thuộc vào điều này. Kiểm tra với if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
1 đã chỉ ra rằng if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
1 không xóa thông tin xác thực với phản hồi máy chủ 401, do đó việc nhấn lại và sau đó chuyển tiếp một lần nữa sẽ mở tài nguyên miễn là các yêu cầu thông tin xác thực không thay đổi. Tuy nhiên, người dùng có thể nhấn phím if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
3 để xóa thông tin xác thực của họ.

Để xác thực HTTP hoạt động bằng máy chủ IIS với phiên bản CGI của PHP, bạn phải chỉnh sửa cấu hình IIS của mình " if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
4". Nhấp vào " if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
5" và chỉ kiểm tra " if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
6", tất cả các trường khác phải được bỏ chọn.

Lưu ý: IIS Lưu ý: Để xác thực HTTP hoạt động với IIS, chỉ thị PHP CGI.RFC2616_Headers phải được đặt thành if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
7 (giá trị mặc định).
: IIS Note:
For HTTP Authentication to work with IIS, the PHP directive cgi.rfc2616_headers must be set to if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
7 (the default value).

derkontrollfreak+9HY5L tại gmail dot com ¶

8 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
8

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
9

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
0

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

kazakevichilya tại gmail dot com ¶

10 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
2

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
3

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
4

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
5

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
6

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
7

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
8

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
9

if (empty(0

if (empty(1

if (empty(2

if (empty(3

if (empty(4

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

quản trị trang web tại Kratia dot com ¶

15 năm trước

if (empty(6

if (empty(7

if (empty(8

if (empty(9

Yuriy ¶

13 năm trước

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
0

Bitman tại Bitworks Dot de ¶

1 năm trước

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
1

quản trị viên tại isprohosting dot com

16 năm trước

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
2

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
3

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
4

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
5

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
6

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Ome ko ¶

12 năm trước

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
8

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
9

HTTP/1.0 4010

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

John_2232 tại Gmail Dot Com ¶

7 năm trước

HTTP/1.0 4012

HTTP/1.0 4013

HTTP/1.0 4014

Ẩn danh ¶

13 năm trước

HTTP/1.0 4015

HTTP/1.0 4016

HTTP/1.0 4017

HTTP/1.0 4018

$_SERVER['PHP_AUTH_DIGEST'])) {
    
header('HTTP/1.1 401 Unauthorized');
    
header('WWW-Authenticate: Digest realm="'.$realm.
           
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');

    die(

'Text to send if user hits Cancel button');
}
// analyze the PHP_AUTH_DIGEST variable
if (!($data http_digest_parse($_SERVER['PHP_AUTH_DIGEST'])) ||
    !isset(
$users[$data['username']]))
    die(
'Wrong Credentials!');// generate the valid response
$A1 md5($data['username'] . ':' $realm ':' $users[$data['username']]);
$A2 md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']);
$valid_response md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2);

if (

$data['response'] != $valid_response)
    die(
'Wrong Credentials!');// ok, valid username & password
echo 'You are logged in as: ' $data['username'];// function to parse the http auth header
function http_digest_parse($txt)
{
    
// protect against missing data
    
$needed_parts = array('nonce'=>1'nc'=>1'cnonce'=>1'qop'=>1'username'=>1'uri'=>1'response'=>1);
    
$data = array();
    
$keys implode('|'array_keys($needed_parts));preg_match_all('@(' $keys ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@'$txt$matchesPREG_SET_ORDER);

    foreach (

$matches as $m) {
        
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
        unset(
$needed_parts[$m[1]]);
    }

    return

$needed_parts false $data;
}
?>
0

Bitman tại Bitworks Dot de ¶

HTTP/1.0 4019

AuthType0

AuthType1

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

1 năm trước

8 năm trước

AuthType3

kazakevichilya tại gmail dot com ¶

15 năm trước

AuthType4

AuthType5

AuthType6

AuthType7

AuthType8

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Yuriy ¶

10 năm trước

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
0

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
1

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
2

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
3

quản trị trang web tại Kratia dot com ¶

15 năm trước

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
4

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
5

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
6

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
7

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
8

function authenticate() {
    
header('WWW-Authenticate: Basic realm="Test Authentication System"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
"You must enter a valid login ID and password to access this resource\n";
    exit;
}
9

 if (!isset(0

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Yuriy ¶

16 năm trước

 if (!isset(2

 if (!isset(3

 if (!isset(4

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Louis ¶

16 năm trước

 if (!isset(6

 if (!isset(7

 if (!isset(8

 if (!isset(9

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n"
;
}
?>
0

CEO tại L-i-e Dot Com ¶

12 năm trước

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
1

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
2

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
3

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
4

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

jake22 tại gmail dot com

7 năm trước

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
6

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
7

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
8

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
9

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
00

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
01

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
02

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

vog tại notjusthosting dot com

10 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
04

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
05

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
06

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Emmanuel Dot Keller tại Net2000 Dot Ch ¶

19 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
08

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
09

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
10

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Thư rác tại Angstzustaen dot de ¶

1 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
12

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
13

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
14

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
15

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
16

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Slamjam ¶

16 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
18

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
19

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
20

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
21

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Sergio Dot Carvalho tại Gmail Dot Com ¶

7 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
23

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
24

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

vog tại notjusthosting dot com

7 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
26

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
27

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
28

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
29

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
30

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
31

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
32

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

vog tại notjusthosting dot com

10 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
34

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
35

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
36

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
37

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
38

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
39

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
40

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
41

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
42

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
43

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Emmanuel Dot Keller tại Net2000 Dot Ch ¶

19 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
45

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
46

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Thư rác tại Angstzustaen dot de ¶

1 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
48

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
49

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
50

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
51

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
52

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
53

 if (!isset(0

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
55

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
56

Slamjam ¶

Sergio Dot Carvalho tại Gmail Dot Com ¶

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
57

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
58

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
59

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
60

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

"
;
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
61

dan223 tại gmail dot com

Lars Stecken ¶

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
62

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
63

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
64

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
65

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

14 năm trước

16 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
67

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
68

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
69

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
70

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Sjeffrey tại Inquises Dot Com ¶

12 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
72

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
73

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
74

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
75

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
76

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
77

jake22 tại gmail dot com

7 năm trước

vog tại notjusthosting dot com

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
79

10 năm trước

16 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
80

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
81

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Emmanuel Dot Keller tại Net2000 Dot Ch ¶

1 năm trước

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
83

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
84

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
85

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
86

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
87

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
88

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Slamjam ¶

vog tại notjusthosting dot com

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
90

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
91

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
92

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
93

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
94

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
95

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
96

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
97

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
98

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

10 năm trước

16 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
00

Emmanuel Dot Keller tại Net2000 Dot Ch ¶

vog tại notjusthosting dot com

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
01

10 năm trước

vog tại notjusthosting dot com

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
02

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
03

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
04

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
05

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
06

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

10 năm trước

Emmanuel Dot Keller tại Net2000 Dot Ch ¶

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
08

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
09

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
10

19 năm trước

16 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
11

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
12

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
13

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
14

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
15

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
16

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
17

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
18

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Thư rác tại Angstzustaen dot de ¶

12 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
20

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
21

if (empty(7

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
23

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
24

jake22 tại gmail dot com

1 năm trước

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
6

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
7

$_SERVER['PHP_AUTH_USER']) ||
    (
$_POST['SeenBefore'] == && $_POST['OldAuth'] == $_SERVER['PHP_AUTH_USER'])) {
    
authenticate();
} else {
    echo 
"

Welcome: " htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "";
    echo 
"Old: " htmlspecialchars($_REQUEST['OldAuth']);
    echo 
"\n";
    echo 
"\n";
    echo 
"htmlspecialchars($_SERVER['PHP_AUTH_USER']) . "\" />\n";
    echo 
"\n";
    echo 
"

\n";
}
?>
8

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
28

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
00

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
01

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    
header('WWW-Authenticate: Basic realm="My Realm"');
    
header('HTTP/1.0 401 Unauthorized');
    echo 
'Text to send if user hits Cancel button';
    exit;
} else {
    echo 
"

Hello {$_SERVER['PHP_AUTH_USER']}.

";
    echo 
"

You entered {$_SERVER['PHP_AUTH_PW']} as your password.

"
;
}
?>
02

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
32

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Slamjam ¶

19 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
34

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
35

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Thư rác tại Angstzustaen dot de ¶

vog tại notjusthosting dot com

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
37

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
38

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
39

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
40

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
41

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

10 năm trước

16 năm trước

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
43

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
44

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
45

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
46

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
47

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
48

$realm 'Restricted area';//user => password
$users = array('admin' => 'mypass''guest' => 'guest');
1

Làm thế nào để xác thực PHP hoạt động?

Sau khi nhận được chi tiết xác thực người dùng trong PHP, nó so sánh dữ liệu biểu mẫu với cơ sở dữ liệu người dùng bằng cách thực thi truy vấn bằng cách sử dụng đối tượng kết nối.Truy vấn liên kết tên người dùng được nhập bởi người dùng thông qua biểu mẫu HTML.Sau đó, nó xác minh mật khẩu băm bằng mật khẩu đã nhập để trả về kết quả xác thực.

Làm thế nào tôi có thể làm Auth trong PHP?

Chỉ cần chạy php Artisan Make: Auth và PHP Artisan di chuyển trong một ứng dụng Laravel mới.Sau đó, điều hướng trình duyệt của bạn đến http: //your-app.test/register hoặc bất kỳ URL nào khác được gán cho ứng dụng của bạn.Hai lệnh này sẽ chăm sóc giàn giáo toàn bộ hệ thống xác thực của bạn!php artisan make:auth and php artisan migrate in a fresh Laravel application. Then, navigate your browser to http://your-app.test/register or any other URL that is assigned to your application. These two commands will take care of scaffolding your entire authentication system!

Xác thực và ủy quyền trong PHP là gì?

Điều này thường liên quan đến việc kiểm tra tên người dùng và mật khẩu đơn giản.Do đó, một người dùng được đăng nhập là một người dùng được xác thực.Ủy quyền, thường được gọi là Kiểm soát truy cập, là cách bạn bảo vệ quyền truy cập vào các tài nguyên được bảo vệ và xác định xem người dùng có được phép truy cập một tài nguyên cụ thể hay không.