php - PHP_AUTH_USER only known in certain frames -
getting confused php_auth_user. within web pages have .htaccess files in every directory, controlling can (and cant) see folders. in order further customise pages hoping use php_auth_user within php code, i.e. tailor page contents based on user.
this seems work partially. code snippets below demonstrate problems.
the main index.php creates framed page menu structure in top left hand corners, irrelvant stuff in top right , tailor made contents in bottom frame. in top left user correctly shown, in bottom frame php_auth_user doesnt seem set anymore (it returns empty , when printing $http_server_vars not listed).
script.php in different path, have .htaccess files in them , other contents displayed correctly. why not know php_auth_user there?
running version php version 5.2.12 on chrome.
index.php
<frameset rows="35%, *"> <frameset cols="25%, *"> <frame src="menu.php"> <frame src="something.php"> </frameset> <frame src="../otherpath/script.php?large=1" name="outputlisting"> </frameset> </frameset>
menu.php
<ul> <li>reporting <ul> <li>link1 <a href="../otherpath/script.php" target="outputlisting">all</a>, <a href="../otherpath/script.php?large=1" target="outputlisting">big</a> </ul> <?php echo 'ip address: ' . $_server['remote_addr'] . '<br />'; echo 'user: ' . $_server['php_auth_user']; ?>
script.php
<?php echo 'user: ' . $_server['php_auth_user']; ?>
i did test using code provided , not reproduce. username correctly showed on both pages-- when removed .htaccess 1 of directories.
what version of apache running? how php configured? mpm worker being utilized?
Comments
Post a Comment