i got an error while trying to add new row of the table, everything is normal and i can export my html page to ms word.
im getting error like this
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\exportword2.php:216) in C:\xampp\htdocs\test\exportword2.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\exportword2.php:216) in C:\xampp\htdocs\test\exportword2.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\exportword2.php:216) in C:\xampp\htdocs\test\exportword2.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\test\exportword2.php:216) in C:\xampp\htdocs\test\exportword2.php on line 220
here is my code
<tr>
<td>13. </td>
<td>Upah Pekerja</td>
<td>:</td>
<td>Minimum</td>
<td colspan="4">Rp. 100000</td>
</tr>
<tr>
<td></td>
<td></td>
<td>:</td>
<td>Maximum</td>
<td colspan="4">Rp. 100000</td>
</tr>
<tr>
<td></td>
<td>Upah Pekerja Harian</td>
<td>:</td>
<td>Minimum</td>
<td colspan="4">Rp. 100000</td>
</tr>
<tr>
<td></td>
<td></td>
<td>:</td>
<td>Maximum</td>
<td colspan="4">Rp. 100000</td>
</tr>
<tr>
<td>14.</td>
<td>Sistem Hubungan Kerja</td>
<td colspan="6">:</td>
</tr>
<tr>
<td></td>
<td>a. Untuk Waktu Tertentu</td>
<td colspan="6">: 3 Orang</td>
</tr>
<tr>
<td></td>
<td>b. Untuk Waktu Tidak Tertentu</td>
<td colspan="6">: 3 Orang</td>
</tr>
</table>
<?php
header("Content-Type: application/vnd.msword");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=hasilekspor.doc");
?>
</body>
i already done exporting until i add new row of table, i got an error above
error occure when i add new row after this row
<tr>
<td>13. </td>
<td>Upah Pekerja</td>
<td>:</td>
<td>Minimum</td>
<td colspan="4">Rp. 100000</td>
</tr>
refer to the documentation :
header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
<?php
// header must be before any sent output
header("Content-Type: application/vnd.msword");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("content-disposition: attachment;filename=hasilekspor.doc");
?>
<html>
...
</html>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.