2012-01-11 20 views
-1

私はPHP開発者です。私は、CURLを使用して送信された要求でユーザーが設定した「認証変数」を取得する際に問題が発生しています。PHPヘッダ情報

私のphpコードのカール要求時に、これらの変数をユーザーが設定することができません。事前に感謝してください。

+0

$username = $_SERVER['PHP_AUTH_USER']; $password = $_SERVER['PHP_AUTH_PW']; 

これはあなたに別のダイジェストを処理する方法のアイデアを与えるだろうあなたはどうやってそれをしようとしていますか?これまでにコードの点であなたが持っているものを投稿してください。 –

答えて

0

あなたが探している値が$ _SERVER変数にある可能性はありますか? http://www.php.net/manual/en/reserved.variables.server.phpから

'PHP_AUTH_DIGEST' 
When doing Digest HTTP authentication this variable is set to the 'Authorization' header sent by the client (which you should then use to make the appropriate validation). 

'PHP_AUTH_USER' 
When doing HTTP authentication this variable is set to the username provided by the user. 

'PHP_AUTH_PW' 
When doing HTTP authentication this variable is set to the password provided by the user. 

'AUTH_TYPE' 
When doing HTTP authenticated this variable is set to the authentication type. 

あなたはこのように、これらの変数にアクセスすることができる必要があります:http://php.net/manual/en/features.http-auth.php

関連する問題