Hi.
Try adding session_start(); at the top of the php download page, then before the page even shows, check for certain variables:
<?php
// Start the session
session_start();
// Check to see if they've logged in:
if(!isset($_SESSION['active'])){
// Not logged in, Don't let them download
}
if($_SESSION['active'] == true && (!isset($_SESSION['download'])){
// Don't have a download url, they get nothing
}
if(($_SESSION['active'] == true) && (isset($_SESSION['download'])) && (!isset($_SESSION['time_left'])){
// No time to download!!
}
if(($_SESSION['active'] == true) && (isset($_SESSION['download'])) && ($_SESSION['time_left'] > 0){
// They have time left in their session, let them download.
}
You would set these variables like so:
$_SESSION['var_name'] = "some data";
To use the time function, I don't know much about it, but I do know that you could make their session time-out. Perhaps what would be better is to do this:
if(($_SESSION['active'] == true) && (isset($_SESSION['download'])) && ($_SESSION['time'] > date(r)){
You would set $_SESSION['time'] to like 10, 15, 20 minutes or however long you want by manipulating the date function:
http://us2.php.net/manual/en/function.date.php
Hope I helped.
~Brett