2012-01-11 4 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