Hello,
I am trying to download the document when I click on a link. The document has already been uploaded to the database. I am getting some strange errors. Can someone figure out what's the problem? Here is my code...
$dfilename="test.doc";
$sqlstmt = "select fileloc, note_name, added_on, added_by from esc_notes where esc_id = $esc_id and note_type = 'DL' order by added_on";
$result = mysql_query($sqlstmt) or die (getSQLError($sqlstmt));
print<<<EOF
<h3>Case Documents</h3>
<p align=right><a href="escalation.php?action=uploadFile&esc_id=$esc_id">Add Document</a></p>
<table border=1 width=100%>
<tr>
<th>Document Name</th>
<th>Added on </th>
<th>Added by </th>
</tr>
EOF;
while($line = mysql_fetch_row($result)) {
print<<<EOF
header("Content-type: application/msword doc");
header("Content-Disposition: attachment; filename=$dfilename");
header("Content-Transfer-Encoding: binary");
<tr>
<td><a href="$line[0]">$line[1]</a></td>
<td>$line[2]</td>
<td>$line[3]</td>
</tr>
EOF;
}
print "</table>";
}
I get an error where the header is. The link is where $line[1] is.
Thanks in advance,
Stephanie