password_protect.php: how to have multiple password protected pages

Started by conover, April 14, 2015, 08:51:45 AM

conover

I am using password_protect.php to password protect some pages on my site.  I want to have different passwords for each page. The first page works fine, but the second one does not. The php files are located in different folders. Any idea what I might be doing wrong?
Thanks.

zubrag

password_protect serves to restrict access to multiple pages, similar to how you use one user/password to login to your operating system and see everything that is there.

To have separate password for each page - you can create separate copy of password_protect.php for each page you want to protect, and use specific password there.

Example:
password_protect1.php will have user1/password1 and you add path to this file in your webpage1
password_protect2.php will have user2/password2 and you add path to this file in your webpage2
...

this way each page will be protected with its own set of passwords

nathanhollis


password_protect serves to restrict access to multiple pages, similar to how you use one user/password to login to your operating system and see everything that is there.

To have separate password for each page - you can create separate copy of password_protect.php for each page you want to protect, and use specific password there.

Example:
password_protect1.php will have user1/password1 and you add path to this file in your webpage1
password_protect2.php will have user2/password2 and you add path to this file in your webpage2
...

this way each page will be protected with its own set of passwords

You are right. what you are doing sounds okay to me. I would also clear cache if it still doesn't work. My most of the problems solves when I refresh and restart browsers. Minor thing but solves problem most of the time.