假設我有如下的PHP代碼:隱藏文本區時轉換爲微軟Word
<form method="post" action="htmltortf.php">
<table>
<tr>
<td>Candidate Name:</td>
<td colspan="3"><textarea cols="40" rows="10" name="textArea"><?php echo $var = isset($_POST['textArea']) ? $_POST['textArea'] : ''; ?></textarea></td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="submit" value="submit" /></td>
</tr>
</table>
<?php
if(isset($_POST['submit']))
{
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=html2doc.doc");
}
?>
我需要什麼:
我想,當上按鈕,用戶點擊提交,它會生成到Ms字,但對於textArea,我不希望它顯示它的邊框樣式或...我只想顯示它的值.eg:This is the textArea in the Ms word file
。
的問題:
當我轉換,它仍然顯示的textarea的邊框一樣的風格和滾動...
我不知道如何解決這個任何人都請幫助我,
謝謝。
我沒有看到你創建word文件的代碼。 – 2012-09-11 03:53:51
我在php標籤中寫了它。 – user1629258
你的輸出標題聲稱你有一個word文檔,這並不意味着你有一個有效的word文檔。您不能通過更改文件名稱將html轉換爲單詞。 – 2012-09-11 03:59:24