It's not clear what you're trying to do here: it would help if you broke the problem down into small parts and told us where you're stuck, maybe sharing some of the things you have tried. You might find How to ask questions the smart way. helpful for getting the most out of this site.

Here's my guess at what you want to do:

  1. Display an HTML form to the user.
  2. Process the user's input.
  3. Generate feedback as plain text or a Word document.
  4. Return this feedback to the user somehow.

Assuming I've guessed correctly, you can perform each of these stages as follows:

  1. Use a templating system (you mention Embperl) to generate the form, filling in data as required. Alternatively, use CGI's HTML output features.
  2. Write a handler using CGI, mod_perl or whatever you use.
  3. You will find plain text easier and more widely supported. If you want prettier layout, use RTF or PDF instead. Only use Word documents if you absolutely must: in general you'll find RTF an acceptable, better supported substitute.
  4. Either return the document directly from your handler, setting the appropriate MIME type in the Content-type HTTP header field, or write the file to disk and reference it with a hyperlink. If you reference the file, you should write a cron job to clear up old files.

In reply to Re: Save results on web page to doc or txt by tomhukins
in thread Save results on web page to doc or txt by Wampa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.