add real pdf
This commit is contained in:
@@ -14,18 +14,24 @@ function priceid_kuri($id){
|
||||
function file_kuri($hash) {
|
||||
|
||||
|
||||
// $price = db_get("SELECT `pricename` FROM price WHERE `pricehash` = $hash LIMIT 1");
|
||||
// $id = $price['price_id'];
|
||||
$price = db_get("SELECT `pricename` FROM price WHERE `pricehash` = $hash LIMIT 1");
|
||||
|
||||
// $pdffile = "/vhosts/an/httpdocs/files/pdf/pdf/$id.pdf";
|
||||
|
||||
$pdfile = '/vhosts/anpdf/app/pub/files/promo.pdf';
|
||||
if (!isset($price['price_id'])){
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
return False;
|
||||
}
|
||||
|
||||
$id = $price['price_id'];
|
||||
$pdfile = "/vhosts/an/httpdocs/files/pdf/pdf/$id.pdf";
|
||||
|
||||
$request = $_SERVER['REQUEST_URI'];
|
||||
$filename = basename($request);
|
||||
|
||||
if (file_exists($pdfile)) {
|
||||
if (!file_exists($pdfile)) {
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (ob_get_level()) {
|
||||
ob_end_clean();
|
||||
@@ -40,8 +46,6 @@ function file_kuri($hash) {
|
||||
header("Expires: 0");
|
||||
readfile($pdfile);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user