Use PHP to create a DOC file on a Unix Box based on an HTML webform selection

可紊 提交于 2019-12-02 17:59:31

问题


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

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.

Any Ideas


回答1:


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>

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

  • Create Word Document using PHP in Linux
  • Reading/Writing a MS Word file in PHP


来源:https://stackoverflow.com/questions/1587890/use-php-to-create-a-doc-file-on-a-unix-box-based-on-an-html-webform-selection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!