Hi, is there a way to password protect a directory in PHP?
Password protection
Collapse
X
-
yes and no. since directory access usually happens without the participation of PHP, a native implementation is pointless. So you have to protect the directory through means of the systems involved. that is the web server (e.g. Apache) for HTTP access (via internet) or the File System (the OS) for any type of access.
for Apache you could just set up the appropriate access rights (there is an extensive article on authentication).
Comment