Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I generate PHP output for downlaod to the client?

Status
Not open for further replies.

awingnut

Programmer
Feb 24, 2003
759
US
I have a PHP script that extracts a bunch of data and formats it. Now I want to download it to the client rather then just display it as garbage in the browser. How do I accomplish that? Is this one of those occasions where I need to use the PHP header function? I can't seem to come up with the right key words as my searches don't produce anything useful. TIA.
 
Yes, you will have to use PHP's header() function.

Look on the PHP online manual page on header() (link) at the example code. Look near the bottom of the page, just before the beginning of the user-supplied comments, for the text "content-disposition".

Keep in mind that how well browsers follow the instructions of the content-disposition header vary. IE seems to be pretty hard-headed and wants to do its own thing.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top