使用 PHP 在基于 HTML 网络表单选择的 Unix Box 上创建 DOC 文件

2022-01-06 00:00:00 ms-word php html webforms doc

我有一个 HTML 文件,其中包含一个包含多个问题的网络表单,这些问题的回答是是"/否".

I have an HTML file which contains a webform with multiple questions which have a YES / NO responses.

如果问题的答案是是",我希望将预定义的(每个问题)文本部分写入服务器上的 DOC 文件,但仅在按下提交按钮后(这样,如果用户改变主意并将答案形式从是"更改为否",我不必重新编写文档).

If the question has a YES answer, I would like a predefined ( per question ) section of text to be written to a DOC file on the server, but only AFTER the submit button has been pressed ( this way, if the user changes their mind and changes an answer form YES to NO, I won't have to re-write the doc ).

当用户点击提交后,文件应显示为下载.

When the user has clicked Submit, The file should be presented as a download.

任何想法

推荐答案

你只需要像这样将你的 html 表单链接到一些脚本(php、jsp、...)

you only have to link your html form to some script (php, jsp, ...) like this

<form action="/myscript.php" method="post">
   YOUR FORM
   <input type="submit" value="Send Form">
</form>

然后脚本完成整个工作...这里有一些 php 示例:

Then script does the whole work...here are some examples for php:

  • 在 Linux 中使用 PHP 创建 Word 文档
  • 在 PHP 中读/写 MS Word 文件

相关文章