<?php
//you can get data from database in here
$user = 'some value';
if($user == 'some value')
{
$file = "test.pdf";
header('Content-type: application/pdf');
header("Content-Disposition: inline; filename=".$file);
//this line will make the file directly download
/* header("Content-Disposition: attachment; filename=".$file); */
header('Cache-control: private');
header('Expires: 0');
readfile($file);
}
else
{
echo 'you cannot access this file';
}
?>
Get Free Sinhala IT Learning Videos Kuppiya.com
No comments:
Post a Comment