Using PHP to Password-Protect Folders/Sub-Folders

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: egami, macek, gesf

Post Reply
chorn
php-forum Active User
php-forum Active User
Posts: 451
Joined: Fri Apr 01, 2016 2:18 am

Sun Apr 10, 2016 11:07 pm

if you want your files to be downloadable only by verified users you have to protect them from beeing accessed via www in the first place. so place a htaccess with "deny from all" in the files root folder. after that you have the options to 1. generate a htpasswd with the user credentials or 2. use a php script with readfile() to passthrough the file contents on valid login

Post Reply