Re: header problem - want to display html AND download a file

From: Chung Leong (chernyshevsky_at_hotmail.com)
Date: 02/11/04


Date: Tue, 10 Feb 2004 19:05:16 -0500

It's a bird. It's a plane. No, it's the invisible inline frame!

There's some test code:

test.php:

<html>
<body>
<p>The download will start now!</p>
<iframe src="test2.php?query=<?=$query?>" style="display: none"></iframe>
<p>Something something...</p>
</body>
</html>

 test2.php:

<?

header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=\"testing.txt\"");

echo str_repeat("Hello world\n", 1000);

?>

Uzytkownik "mike" <mike@dogstar1.com> napisal w wiadomosci
news:808dc180.0402101030.2a3b7395@posting.google.com...
> ok here's the problem:
>
> I have a page that displays a form for user to select individual
> fields and to specify their own criteria which is used to query a
> database and then create an excel spreadsheet and download it to their
> PC.
>
> when the user clicks on the "create a custom query" link on the
> reports page the file customss.php displays the form that list the
> various fields and criteria to specify for the search. This part
> works fine.
>
> once the user clicks the button to submit the query the file
> customssdisplay.php generates the Excel file and then sends it to the
> client PC.
>
> The problem is that once the user cliks the button to submit the
> query, the form which displays the list of available criteria and
> fields is still displayed EVEN AFTER the spreadsheet has been
> downloaded to the PC.
>
>
> Here's what I would like to happen is:
>
> 1)user clicks button to create the custom query
>
> 2)the form is displayed for the user to check fields for inclusion and
> specify search criteria.
>
> 3)user chooses what they want and then clicks "submit query"
>
> 4)******* A page displays saying something like "Generating
> report...."
>
> 5)Excel File is sent to user's PC.
>
>
>
> OK now I've tried specifying a bit of html in the customssdisplay.php
> file that generates the spreadsheet but this gives me error messages
> saying that the header has already been sent. I suppose I could
> create a passthrough file which creates a form with all the fields
> hidden (taken from the search criteria page) but this seems cumbersome
> and inefficient. I would appreciate any help that could be offered.



Relevant Pages

  • Re: Report parameters
    ... I open the report, frmSpecifyRecord shows up, I ... Another field in the query is SessionDate. ... Between And as the criteria, ... Now I want to specify the date range on frmSpecifyRecord, ...
    (microsoft.public.access.reports)
  • Re: Hep with querying between two dates
    ... I had used it to show multiple criteria in a single field, ... I want a form that shows all information and the ability to specify ... Start and End in the Form, not the query. ... and the Removed criteria is on the second ...
    (microsoft.public.access.forms)
  • header problem - want to display html AND download a file
    ... when the user clicks on the "create a custom query" link on the ... various fields and criteria to specify for the search. ... hidden (taken from the search criteria page) but this seems cumbersome ...
    (comp.lang.php)
  • Re: Runtime error 13 Type mismatch - something to do with date??
    ... 'Build criteria for Date due for Beginning Date and/or Ending Date ... If you specify only txtenddate, ... > I have a query with the same search facilities and that works fine. ... > brought up the parameter boxes because some of the SQL had. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Filtering a subform using many combo boxes
    ... SELECT AssignedPriority, AssignedPriorityDetail FROM tblAssignedPriority ... YES for all of the combo boxes.) ... I followed you instructions to the letter and every one of the criteria ... open the query "qryProjects" in design view. ...
    (microsoft.public.access.forms)