if the member's info is in the session, you can get it on any page that calls session_start(). If you have a dedicated table for this information, you can do this on the download processing page. It would go something like this.
- Link to the processing page with the file id in the URL (ex: href="download_file.php?file_id=12345"). If you want to hide the file id, you can use a form (with method="post") and post a hidden field with the file id in it:
<form method="post" action="download_file.php">
<input type="hidden" name="file_id" value="<?=$file_id;?>">
.
.
- On download_file.php, you can then get the user's id and credentials and do whatever you want with them.
- When you have confirmed that the download is ok, you can use something like the following.
$query = 'INSERT INTO file_downloads SET user_id='.$SESSION['user_id'].', file_id='.$GET['file_id'];
and then of course, run the query. =]