Thats where the "session" variable comes into play. Look at Number 3 in my first post.

Once the user has logged in, You could say something like:

psydo code

Code:
if session == any username in the database then
     download file
else
     do something else
end if