How to set REMOTE_USER
I'm developi开发者_JS百科ng a PHP-based application that will be used in a sigle sign-on environment. I rely on the REMOTE_USER variable for user information. Is it possible set REMOTE_USER on my local machine (MAMP on Mac OS 10.6) using dummy values to make local development easier?
Somewhere in a config file or at the top of your file, write:
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1')
$_SERVER['REMOTE_USER'] = 'whatever';
精彩评论