First thing we need to know: After the user submits the form, where and how are you directing the user?
It's not clear what exactly you want to do. You say you can already receive the form, and you have a perl script that "generates a html file" from the form information, correct? So what do you mean by wanting to "get it to automactically save the output as a html file"? You just said you are doing that already....
I suppose you mean that when you "open the page's source and copy/pasting", you must be doing that manually,and you want to avoid that. No problem:
option 1: the script is already saving an html file, so have the script generate the entire html file that you want, overwrite the existing file, and then redirect the user to the newly created file
option 2
: if the html file is too complicated to convert it so the the perl script generates it, the just have the perl script parse the existing html file and stick in the data where the data should go. You would probably have to put some markers in the html file to tell your script where to put the data.
option 3
: bypass the creation of a file altogether, and have the perl script just output the html directly to the user's browser. This is my preferred way.
option 4
: Just do what you are doing now, but just use Server Side Includes in your main html file to stick in the data from the newly created file that contains the form information. Not difficult to do as long as your webserver can do SSI's.
By the way, your thread says "How can I save the output as a .html file?" Just in case this is really what you are asking: an html file is just a text file. Have your perl script output the text, save it with a ".html" extension, then that's it - it's an html file.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.