Thanks for your input. It isn't intended for guests, but for all users. Guests will have additional restrictions (i.e. they won't even be able to see ANY link). What you suggested looks like it might work. I had a feeling that I would have to use the database.
One thing though, I won't be hosting the files on my server. I'll be hosting the files at an external file server which has limited bandwidth, so I don't want people hotlinking or sharing the download links. Would I still be able to do it, even with the files on a different server?
How does the above code work? Does the database store the file's actual URL, then a PHP file is used to produce a temporary URL, or does the database store both the actual file's URL AND the temporary URL?
In summary, say the file is File.txt, and it's direct download link is at
http://filehost.tld/File.txt, then I want to serve the file to a user at
http://mysite.tld using a temporary download link (e.g.
http://mysite.tld/ddl/122151).