I want users who visit my site with a valid URL (get parameter is checked in database)
to be able to download a file from the server while others who don't access the site with a valid URL aren't able to do so.
Currently i am able to do
if (isValid($get_param))
{
print link to file
} else {
print some other message
}
This is fine but doesn't prevent someone from simply visiting the direct link to the file say site.com/file.mp3
.
How do I prevent someone from being able to download the file in that manner but allow them download it if the URL has a valid get parameter?