Thread: Random links
View Single Post
Old 09-02-2009, 06:10 PM   #8 (permalink)
KingOfTheSouth
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default

Quote:
// Check of expired download links
$expire = time() - 30 * 60 * 60; // Links created 30 minutes ago are expired
$sql = "DELETE FROM access WHERE down_created < {$expired}";
mysql_query($sql);
// Now process the download
$id = $_GET['id'];
$id = mysql_real_escape_string($id);
$sql = "SELECT * FROM access WHERE down_id='{$id}'";
$rs = mysql_query($sql);
if (mysql_num_rows != 1) {
die('Unauthorized access!');
} else {
// Allow download of file
}
I understand that more than any of the others my problem is actually knowing how to set it up correctly on a page and working.
KingOfTheSouth is offline  
Reply With Quote