Hi,
You can secure your files quite easily with the help of mod_rewrite.
Heres an example.
Let's say you have a folder in your www-root called pdf.
Create this .htaccess file and copy it to the pdf folder:
RewriteEngine On
# Condition to check that the file exists
RewriteCond %{REQUEST_FILENAME} -f
# And redirect .pdf files to download.php
RewriteRule ^(.+)\.pdf$ download.php?file=$1 [L,NC,QSA]
Then create download.php and copy it to pdf folder also:
<?php
session_start();
if (!isset($_GET['file']))
{
exit;
}
if (!isset($_SESSION['logged_in']))
{
echo 'You are not authorized to download this file!';
exit;
}
$file = $_GET['file'].'.pdf';
if (file_exists($file))
{
header('Content-type: application/pdf');
readfile($file);
exit;
}
In this example, we check that there is a session variable $_SESSION['logged_in']. You probably have similar in your auth so copy that name to this script.