Heres a page I wrote for downloading stuff from a folder that I dont want the public to know exists, This also qrites a textfile for use as a counter to track downloads.
you need two parts (requestfile.php - the bit the user sees) and download.php, (this should remain invisible to the user and if given the $filename will return nothing)
so here goes:
------------------requestfile.php
<?php
$folder="hidden_folder";
if(!file_exists("$folder/$filename"

){
echo "<html><head><title>404 - File not found</title></head<<body>";
echo "<h1>Unspecified file or file not found</h1><br> File: <b>$filename</b> Not located on this server";
echo "</body></html>";
}else{
if(isset($filename)){
$counter = "$filename.txt";
if(!file_exists($counter)){
echo "File: $filename has been downloaded 0 times<br>";
}else{
$fd = fopen ($counter, "r"

;
$count = fread ($fd, filesize ($counter));
fclose ($fd);
echo "File: <b>$filename </b>has been downloaded <b>$count</b> time(s)<br>";
}
echo "<a href=download.php?filename=$filename&count=$count&counter=$counter>download it</a>";
}else{
echo "<h1> Select a file you muppet!</h1>";
}
}
?>
-------------------download.php
<?php
$folder="hidden_folder";
if(isset($filename)){
if(file_exists("$folder/$filename"

){
$size = filesize('$folder/$filename');
header("Content-Type: application/save"

;
header("Content-Length: $size"

;
header("Content-Disposition: attachment; filename=$filename"

;
header("Content-Transfer-Encoding: binary"

;
$fh = fopen("$folder/$filename", "r"

;
fpassthru($fh);
// increment counter
$count++;
$fp=fopen("$counter","w"

;
fputs($fp, $count);
fclose($fp);
exit;
}else{
echo "No file selected";
}
}else{
echo "<h1>Use the proper file selection method or go away!</h1>";
}
?> ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.