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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to excel

Status
Not open for further replies.

dkemas

Programmer
Mar 22, 2012
70
GB
I am trying to export some info to excel, it's working perfectly fine however the html of the page is also being exported into excel.

Here's a basic example of what I am doing

Code:
<?php
Header("Content-Disposition: attachment; filename=export.csv");
print "boom";
?>

<html>
<head></head>
<body></body>
</html>

In Excel I get

boom
<html>
<head></head>
<body></body>
</html>

How do I get it to not output the html also?

Thanks
 
Hi

You can not send more than one content in a response.

What exactly you want ? A downloadable CSV file ? Then send no HTML, only the CSV.

Feherke.
[link feherke.github.com/][/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top