PHP: Simple way to Limit File downloads to URLs with valid get parameters
<p>I want users who visit my site with a valid URL (get parameter is checked in database)</p>

<p>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.</p>

<p>Currently i am able to do </p>

<pre><code>if (isValid($get_param))
{
    print link to file
} else {    
    print some other message
}
</code></pre>

<p>This is fine but doesn't prevent someone from simply visiting the direct link to the file say <code>site.com/file.mp3</code>.</p>

<p>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?</p>
