假设我有如下的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