File manager - Edit - /home/autoph/public_html/tasks/pdf/pdf_view.php
Back
<?php include '../cfg/db.php'; // echo "\n\n\n\n".$_SERVER['HTTP_REFERER']; $main_uri = $global_system_settings['url']; if(!isset($_SERVER['HTTP_REFERER'])){ header('Location: '.$main_uri); exit; } $pdf_viewer_loc = $main_uri.'plugins/pdfjs/web/viewer.php'; $pdf_viewer_loc_arr = (parse_url($pdf_viewer_loc)); $pdf_viewer_loc_path = $pdf_viewer_loc_arr['path']; $ref_arr = parse_url($_SERVER['HTTP_REFERER']); $ref_arr_path = $ref_arr['path']; if($ref_arr_path != $pdf_viewer_loc_path){ header('Location: '.$main_uri); exit; } if(!isset($_REQUEST['file'])){ header('Location: '.$main_uri); exit; } // Store the file name into variable $file = $_REQUEST['file'];//'filename.pdf'; $information = explode("@", $file); if(count($information) !== 2){ header('Location: '.$main_uri); exit; } $type = intval($information[1]); switch($type){ case 1: // $dir = "../dist/attachments/".$information[0].".pdf"; // break; case 2: $dir = "../dist/attachments/".$information[0].""; break; case 3: $dir = "../dist/knowledgebase/".$information[0].""; break; case 4: $dir = "../dist/videos/resources/".$information[0].""; break; default: // $dir = "../dist/filenotfound.pdf"; header('Location: '.$main_uri); exit; } $filename = basename($dir); // Header content type // header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="' . $filename . '"'); header('Content-Transfer-Encoding: binary'); header('Accept-Ranges: bytes'); // Read the file @readfile($dir); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings