jzimmerlin Posted December 28, 2006 Share Posted December 28, 2006 I know it's possible to get the values of PHP_AUTH_USER and PHP_AUTH_PW (for example: $user=$_SERVER['PHP_AUTH_USER']), but is it possible to set these values using PHP (for example: $_SERVER['PHP_AUTH_USER']=$user)?Jeff Quote Link to comment https://forums.phpfreaks.com/topic/32008-php_auth_user-and-php_auth_pw-question/ Share on other sites More sharing options...
jzimmerlin Posted December 31, 2006 Author Share Posted December 31, 2006 Bueller? Quote Link to comment https://forums.phpfreaks.com/topic/32008-php_auth_user-and-php_auth_pw-question/#findComment-150511 Share on other sites More sharing options...
wildteen88 Posted December 31, 2006 Share Posted December 31, 2006 Yes, but that will only work for the script those variables where set in. It will not be carried over to the next page when you go to echo $_SERVER['PHP_AUTH_USER'];The server variables are defined by the server its self when the script is being process. So any work you did on the server variables will be lost the next time you go to use them. Quote Link to comment https://forums.phpfreaks.com/topic/32008-php_auth_user-and-php_auth_pw-question/#findComment-150513 Share on other sites More sharing options...
jzimmerlin Posted December 31, 2006 Author Share Posted December 31, 2006 OK... here's what I'm trying to do, maybe you can tell me if there is some other way to do it.I need to protect the content on my web site so that only people that login using an HTML form can download pictures, videos, etc in specific directories. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/32008-php_auth_user-and-php_auth_pw-question/#findComment-150559 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.