Hi. I am currently working a site with .pdf files in a folder restricted through the ISP's control panel, which is as should be. However, there is a custom PHP script allowing users to log in against a database of username/password. I set a session variable upon validation, and check for it on each .php page within a "protected" directory. However, I have no idea how to protect the pdf's from outside viewing without using the cp to set the .htacess file for the directory.
Now, I've searched the forums and checked out the PHP manual - perhaps my brain isn't working all too well right now, but the answers aren't really making much sense. The PHP_AUTH_USER, PHP_AUTH_PW, and PHP_AUTH_TYPE - are these the things to use to get through the .htaccess directory protection? Or should I use a 'WWW-Authenticate: Basic realm="My Realm"' header? And if so, how exactly do I put this in before the pdf is downloaded to the client? Or do I need to simply send a "valid-user" header?
Like I said, it just doesn't seem to be making much sense to me right now - my brain is beginning to hurt - so sorry if the question is very basic. If there are any tuts anyone knows of that explain things in depth, I'd really appreciate a pointer to the addy. Of course, opinions and instruction are always welcome 😃 .
Thanks!