File you are requesting doesn´t exist (error 01)"; } } else { //Hmm, I guess they forgot to ask for a file. echo "

You Didn't request a file. (error 02)

"; } // ------ Everything past here is a work-in-progress ------ // /* MySQL Info Setup // $mysql_host = "localhost"; $mysql_login = "thefinaldegree"; $mysql_passwd = ""; $mysql_database = "thefinaldegree_"; $mysql_table = preg_replace('/[ .]/si', '_', $filename); $mysql_tableprefix = "files_"; $mysql_createtable = 'CREATE TABLE `' . $mysql_tableprefix . $mysql_table . '` (' . ' `Download No.` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,' . ' `Time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,' . ' `Date` DATE NOT NULL ,' . ' `File Exists` BOOL NOT NULL' . ' )'; $mysql_updatetotals = 'INSERT INTO `'.$mysql_tableprefix.'totaldownloadstats` (`Downloads`, `Last Download Time`, `Last Download Date`, `Last File Downloaded`) VALUES (NULL, CURRENT_TIMESTAMP, \'\', \'\'), (NULL, \''.$time.'\', \''.$date.'\', \''.$filename.'\');'; $mysql_updatefiles = 'INSERT INTO `'.$mysql_tableprefix.$mysql_table.'` (`Download No.`, `Time`, `Date`, `File Exists`) VALUES (NULL, CURRENT_TIMESTAMP, \'\', \'\'), (NULL, \''.$time.'\', \''.$date.'\', \''.$file_exists.'\');'; $db = mysql_connect($mysql_host,$mysql_login,$mysql_passwd) or die(mysql_error()); //Connects to MySQL mysql_select_db($mysql_database); //Selects the database $table_exists = mysql_query("select * from " . $mysql_tableprefix . $mysql_table . " LIMIT 0,1"); // ----------------- Everything below here is not my code, just here for learning purposes. ---------------------- // if ($fileexist>0) { $updatequery = "UPDATE " . $mysql_tableprefix . "totaldownloadstats set downloads=downloads+1, lastdownload='$now' where filename='".basename($file)."'") or die (mysql_error()); } else { $addquery=mysql_query("insert into filestats (filename,downloads,lastdownload) values ('".basename($file)."','1','$now')") or die (mysql_error()); } $smysql_updatetotals = 'UPDATE `files_totaldownloadstats` ' . 'SET `Downloads` = Downloads+1, ' . '`Last Download Time` = \'CURRENT_TIME\', ' . '`Last Download Date` = \'04/08/2009\', ' . '`Last File Downloaded` = \''. */ ?>