Hi
I need to click on a button that will download a file.
The problem is how I will indicate a filename.
Files are stored in folders tcp20100220,tcp 20100220.
It depends on a date given by the user.The file in the folder will be named in the same way but will be a pdf file.(tcp201002 20.pdf)
1 .A form is given to the user where he/she enters a date.Then a file is generated in the specific folder.
2. A new html page opens with a download button.
My problem:
Button is html.
The date is received into php as follow
now the download button cannot be created in php so I need to use Html.
Something like the following should be done
Please give me some direction as you can see I have no idea how to go ahead.
I need to click on a button that will download a file.
The problem is how I will indicate a filename.
Files are stored in folders tcp20100220,tcp 20100220.
It depends on a date given by the user.The file in the folder will be named in the same way but will be a pdf file.(tcp201002 20.pdf)
1 .A form is given to the user where he/she enters a date.Then a file is generated in the specific folder.
2. A new html page opens with a download button.
My problem:
Button is html.
The date is received into php as follow
Code:
$indate=$_POST["inputdate"];
echo " indate is".$indate;
//ghet input date
if (isset($_POST["inputdate"])){
$MyToday=date("Ymd");
$MyToday=strtotime($indate);}
else{
$MyToday=$today;}
echo"...";
Something like the following should be done
Code:
<html>
<title>HTML with PHP</title>
<body>
<input type="button" value="Download Result" onClick="window.location.href='http://111.111.11.117/besa/SASoutput/tcp"<?php date('Ymd',$MyToday) ?>>/tcp"<?php date('Ymd',$MyToday) ?>>.pdf">
</html>
Comment