Store in GIT
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
require("inc/connect.php");
|
||||
|
||||
$uid = $_GET['uid'];
|
||||
|
||||
if($uid == "")
|
||||
header("Location: /index");
|
||||
|
||||
//Get file data
|
||||
$query = "SELECT file.id, `file`, project.uid FROM `file`, `project` WHERE file.`project-id`=project.id AND file.uid = '$uid'";
|
||||
$temp = ExecQuery($query);
|
||||
|
||||
if($temp->num_rows < 1)
|
||||
header("Location: /index");
|
||||
|
||||
$result = $temp->fetch_assoc();
|
||||
|
||||
$file_location = "/download/" . $result['uid'] . "/" . $result['file'];
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$id = $result['id'];
|
||||
|
||||
//Add download to database
|
||||
$query = "INSERT INTO `download` (`file-id`, `time`, `ip`) VALUES ($id, NOW(), '$ip')";
|
||||
ExecQuery($query);
|
||||
|
||||
header("Location: $file_location");
|
||||
?>
|
||||
Reference in New Issue
Block a user