Home > Backend Development > PHP Tutorial > 请版主帮忙,请教这是什么意思?

请版主帮忙,请教这是什么意思?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:00:05
Original
1245 people have browsed it

请版主帮忙,请问这是什么意思??
header('WWW-Authenticate: Basic  realm = "Realm-Name"');
header('Status: 401 Unauthorized');
header('HTTP/1.0 401 Unauthorized');
header("Location: http://www.example.com/");
header('WWW-Authenticate: Negotiate');
header('WWW-Authenticate: NTLM', false);
这几个是什么意思??经常在php中看到哦,我在php手册上看,还是不太明白。请指点。谢谢你。
------解决方案--------------------
http://www.php.net//manual/zh/function.header.php
------解决方案--------------------
header('WWW-Authenticate: Basic  realm = "Realm-Name"');
這句用于驗證登入,會彈出一個框讓用戶數據賬號密碼,輸入的賬號和密碼可以通過
$_SERVER['PHP_AUTH_USER'];
$_SERVER['PHP_AUTH_PW'];
獲取進行判斷



header('Status: 401 Unauthorized');
header('HTTP/1.0 401 Unauthorized');
這兩句输出状态值(401)到浏览器,主要用于访问权限控制。


header("Location: http://www.example.com/"); 
頁面302重定向到http://www.example.com


header('WWW-Authenticate: Negotiate');  
設置一個報文信息

header('WWW-Authenticate: NTLM', false); 
設置一個報文信息,因為後面的參數是false, 不會覆蓋之前的Negotiate,所以兩個報文信息會共存

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