請版主幫忙,請教這是什麼意思?
來源:互聯網
上載者:User
請版主幫忙,請問這是什麼意思??
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,所以兩個報文資訊會共存