I want to display pdf file in browser.
odo1.php has the file to select the date.
read.php will read the date from odo1.php.
i have this files 2013-03-26_SAP.pdf, 2013-03-05_SAP and more to come.
the name of this file is combination of date and outlet.
when i change the readfile($filename);
to 2013-03-05_SAP.pdf it work well.
pls help.
file:odo1.php
<form id="contact-form" action="read.php" onsubmit="return validate()" method="post" enctype="multipart/form-data">
<fieldset>
<h4>
Order Date: <input type="date" name="orderdate">
</h4>
</fieldset>
<p></p>
<input type="submit" name="submit" value="View Delivery Order" />
</form>
read.php
<?php
include_once 'admin-class.php';
$admin = new itg_admin();
$admin->_authenticate();
$con=mysql_connect("#","#","#");
mysql_select_db("mdb_lh026", $con);
$id=$_SESSION['admin_login'];
$outlet=("SELECT outlet
FROM pstaff
WHERE staff_id='$id'
");
$orderdate=$_POST['orderdate'];
$filename=('../'.'$orderdate'.'_'.'$outlet'.'.pdf');
header('Content-type:application/pdf');
readfile($filename);
?>