Is there anyway that I can “block” a user from downloading a PDF file on my server using PHP script? That is, to run a MySQL query when the file is being requested, authenticate the user (through a cookie and MySQL query match) and only if the user is authenticated, to serve him the file.
Thanks,
Joel
The general technique is to put your downloadables outside the document root, and then allow access via a PHP script, e.g. something like this…