Sure.
This is the code:
<?
include '../config/common_fns.php';
if (!check_auth_user())
{
header("Location: index.php");
}
else
{
if (isset($story))
$s = get_letter_record($story);
?>
<html>
<body>
<?
header("Content-Disposition: attachment; filename=Standardbrev.doc");
$row = 1;
$handle = fopen ("c:\Report.csv","r");
and so on.....
It works fine with Windows, but when I upload it to a unix server, I get the error:
Warning: Cannot add header information - headers already sent by (output started at /home/sysfrog/public_html/Totland/standardbrev/prove.php:14) in /home/sysfrog/public_html/Totland/standardbrev/prove.php on line 16
header(.... is line 16.
I have read the info. in the php.net manual and know it is caused by that header() must be called before any actual output is sent, and therefore the include() function at start ruins it.
Any suggestion on how to work around this problem.
My goal is to open an MS Word document with a specific letter loaded from a database.
Hope this clearifies it a bit.
Kj.