₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,727 members, 8,423,457 topics. Date: Tuesday, 09 June 2026 at 06:32 PM

Toggle theme

Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingNeed Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] (1104 Views)

1 Reply (Go Down)

Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] by paranorman(op): 3:50pm On Mar 19, 2017
xampp 7.0.1 is what I use for executing my PHP scripts.

the $_SERVER[] superglobal appears not to have these indexes when I print_r() it.

What am I missing? do I have to modify something in the config files?
Re: Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] by Nobody: 6:27pm On Mar 19, 2017
This question is EXTREMELY unclear, so you should not expect any response to be quite honest.

Let me try to help you:
1. What version of PHP came with it (i assume 7.0.0/7.0.1 on guess work)
2. You did not include a screenshot of the DUMP with print_r

At the very least, we did not see your code. So i am sorry, I do not have xampp on my pc, so i cannot really help you, sorry!
Re: Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] by Olyboy16(m): 8:08pm On Mar 19, 2017
paranorman:
xampp 7.0.1 is what I use for executing my PHP scripts.

the $_SERVER[] superglobal appears not to have these indexes when I print_r() it.

What am I missing? do I have to modify something in the config files?
it doesnt work like that sir.
i cant type much code here on mobile, but i'll give you some pseudocode to follow.

when you send these headers to the browser.

header('WWW-Authenticate: Basic realm="some info text"');
header('HTTP/1.0 401 Uauthorized');


The browser prompts for a auth key.

then on submission to the server, you can check those $SERVER indexes.
Re: Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] by paranorman(op):
Olyboy16:
it doesnt work like that sir.
i cant type much code here on mobile, but i'll give you some pseudocode to follow.

when you send these headers to the browser.

header('WWW-Authenticate: Basic realm="some info text"');
header('HTTP/1.0 401 Uauthorized');


The browser prompts for a auth key.

then on submission to the server, you can check those $SERVER indexes.
Thanks, figured it out.
Re: Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] by Nobody: 10:20pm On Mar 19, 2017
oh i see, that is very good
1 Reply

234

Loadednobs Android App Your Reviews NeedBeware Android Developers! Google Has A Warning For YouHow To Display Record From A Database