Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server-side login prompt box

When I log into my router's firmware, for example, I get a prompt box for the username and password, How is this done? As far as I can tell, JavaScript's prompt() only returns one value.. I know it must be server side because the page continues to "load" until I close the box. I also cannot switch tabs in my browser until the box is closed.

Is it possible to do something like this with PHP? How is this done?

Thanks in advance

like image 862
I wrestled a bear once. Avatar asked Dec 26 '22 22:12

I wrestled a bear once.


1 Answers

its done using Basic HTTP Authentication, for this you need to create a user/password file and tell the server that a folder needs to use the Basic HTTP Authentication. This can be done in the server config or in a .htaccess

like image 69
Terry Avatar answered Dec 28 '22 11:12

Terry