Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,721 members, 7,816,970 topics. Date: Friday, 03 May 2024 at 09:36 PM

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

Nairaland Forum / Science/Technology / Programming / Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] (1027 Views)

(2) (3) (4)

(1) (Reply) (Go Down)

Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] by paranorman(m): 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.

1 Like

Re: Need Help With These: $_SERVER["PHP_AUTH_USER"] And $_SERVER["PHP_AUTH_PW"] by paranorman(m): 9:39pm On Mar 19, 2017
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)

Ruby For System Administrators / Search Multiple Tables / Network Security Tools! Super Scan 4 Port Scanner Latest Version

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.