Hi,
How can I hide my download url so that everyone has to register first and not go directly to my
ty,
angelbear
How can I hide my download url so that everyone has to register first and not go directly to my
ty,
angelbear
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
$directory = "/path/to/downloads/"; // Remember the trailing slash here
if ($userIsLoggedIn) // Change this line to whatever you use to check if someone is logged in.
{
$file = preg_replace(array("/\.\./", "!/!"), array("", ""), $_GET['file']); // Replace .. and /, this secures the script somewhat
if (file_exists($directory . $file))
{
header('Content-type: INSERT MIME TYPE HERE'); // You have to change the mime type here to match the mime type of your documents
readfile($directory . $file);
}
else
{
echo "File could not be found.";
}
}
else
{
echo "You have to be logged in to download.";
}
?>