First you need to a htaccess file to protect your folderhow to protect a download folder unauthorized.
you can do so by scripts?:wub:
AuthType Basic
AuthName "restricted area"
AuthUserFile /your_server_path/protect-your-folder/.htpasswd
require valid-user
username:dGakPurkyWmW2
<?php
header("location:../");
?>
$file = $_GET['fileid'];
// query fileid to get real file name in database
$download_folder = '../yourfoldername';
$file = basename($file);
$filepath = "$download_folder/$file";
if (file_exists($filepath)) {
// check users logged in or redirect to login page.
// connect to database
// close database connection
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=$file");
session_write_close();
readfile($filepath);
} else {
header("location:../");
}
$100 to your Paypal
300 Trophy Points
1 banner ad 728x 90
Referral link for :
Webmaster Sun is a forum where you’ll find in-depth discussions and resources to help you succeed on the web whether you are new or experienced. You’ll find it all here. With topics ranging from internet marketing, search engine optimization, social networking, make money online, web hosting, affiliate marketing as well as hands-on technical support for web design, programming and more. We are a growing community of like-minded people that is keen to help and support each other with ambitions and online endeavors. Learn and grow, make friends and contacts for life.
The world's smartest webmasters and internet marketers come here to discuss & share what's trending in the online marketing world!