Hi, I want to make a web page that will download a file and disaply HTML. Like they do at www.cnet.com.
To force a browser to download a file, I do the following:
<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=test");
?>
However if I do this following I get the header already sent error, which I expected:
<html>
<body>
The file is going to download.
</body>
</html>
<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=test.txt");
?>
File content
So is there any way of having a download and HTML in one page??