add pdf download
This commit is contained in:
@@ -14,22 +14,24 @@ function priceid_kuri($id){
|
||||
function file_kuri($hash) {
|
||||
|
||||
|
||||
$price = db_get("SELECT `pricename` FROM price WHERE `pricehash` = $hash LIMIT 1");
|
||||
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
|
||||
|
||||
if (!isset($price['price_id'])){
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
echo "file not found";
|
||||
return False;
|
||||
}
|
||||
|
||||
$id = $price['price_id'];
|
||||
$pdfile = "/vhosts/an/httpdocs/files/pdf/pdf/$id.pdf";
|
||||
$pdfile = "/vhosts/an/httpdocs/pub/files/pdf/pdf/$id.pdf";
|
||||
|
||||
$request = $_SERVER['REQUEST_URI'];
|
||||
$filename = basename($request);
|
||||
|
||||
if (!file_exists($pdfile)) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
return false;
|
||||
echo "file not found";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user