I've a file downloading script that hides the real location from the person who is trying to download the file.
First I run this (don't know if it's right) to get the file_pack and the file_name of the file:
Code: Select all
$result2 = mysql_query('select `file_name` , `file_pack` from '$file_tbl' where `file_id` = "'.$_GET['serve'].'"')
or die( mysql_error() );Code: Select all
$result3 = mysql_query('select `file_name` , `file_pack` from '$user_tbl' where `username` = "'$_SESSION['username']'"')
or die( mysql_error() );IF YOU NEED IT, here is the database structure:
Code: Select all
The user permission table where I will store which users has permission to download which files.
CREATE TABLE `user_perm` (
`perm_id` int(11) NOT NULL auto_increment,
`perm_user` varchar(50) NOT NULL default '',
`file_pack` varchar(30) NOT NULL default '',
`file_name` varchar(100) NOT NULL default '',
`perm_date` varchar(30) NOT NULL default '',
`perm_timestamp` varchar(30) NOT NULL default '',
PRIMARY KEY (`perm_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
The file table where I will store the files:
CREATE TABLE `files` (
`file_id` int(11) NOT NULL auto_increment,
`file_pack` varchar(50) NOT NULL default '',
`file_pack_cat` varchar(50) NOT NULL default '',
`file_cat` varchar(50) NOT NULL default '',
`file_name` varchar(100) NOT NULL default '',
`file_desc` text NOT NULL,
`file_fullname` varchar(100) NOT NULL default '',
`file_downloads` varchar(11) NOT NULL default '',
`file_date` varchar(30) NOT NULL default '',
`file_timestamp` varchar(30) NOT NULL default '',
PRIMARY KEY (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;Best Regards
Oskar R