I try to display a pdf document with code like this:
<?php
session_start();
if (empty($_SESSION['nip']) AND empty($_SESSION['password'])) {
?>
<script type='text/javascript'>
alert('You must login');
document.location='../../../login.php';
</script>
<?php
}else{
include_once '../../../config/core.php';
include_once '../../../config/functioncollection.php';
$kode_materi=antiInjections($_GET['id']);
$querambildata=mysql_fetch_array(mysql_query("SELECT * FROM materi_tb WHERE kode_materi='$kode_materi'"));
$file = "../../../filemateri/".$querambildata['url_materi'];
$filename = $querambildata['url_materi'];
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
@readfile($file);
}
?>
but when I opened, even download the file. how not to automatically download but just open the pdf file. thank you in advance