my goal is to track who is downloading from my server and what they are downloading, and when. I am trying to gather the info for the logged in user, and the file name, in this instance im using movies for an example, and record it to a sql table where i can easily reference it with php my admin. so as of now i have 3 tables set up, one for users, holding all the registration data for my site, username, user id, password email... etc. one for the files holding all the file names with a unique id for each file, and one to log the info to, download tracker, to save the username, user id, email adress, file they are downloading, and a timestamp of when they started the download. so i have set up download links with the movie name in plain text and the movie id as a url variable like this:
<a href="/movies/moviehandaler.php$=1" alt="" >movie x </a>
<a href="/movies/moviehandaler.php$=2" alt="" >movie y </a>
<a href="/movies/moviehandaler.php$=3" alt="" >movie z </a>
they will then pass through to a handler page to log the information and pass through to the dowload like this:
$user_info = ('username', 'email', 'user_id' FROM `users` WHERE 'user_id' = $session_user_id); //is this right?
$movie_id = get['']; //how would i grab the number from the url after "$="
$movie_info = ('movie_name' FROM `movies` WHERE '$movie_id' = 'movie_id'); // is this right?
mysql_query(INSERT '$user_info', '$movie_info', 'time', INTO `download_tracker`); // I know this is wrong, how do i fix it?
header('Location: /movies/<?php print $movie_info ?>'); //is this even posible?
I need help to fix the handaler page so it works... i know im fairly close, i just cant seem to get it right, any help would be greatly apreciated.