Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How can I save the output as a .html file?

by fpi (Monk)
on Mar 15, 2001 at 08:08 UTC ( [id://64612]=note: print w/replies, xml ) Need Help??


in reply to How can I save the output as a .html file?

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.
  • Comment on Re: How can I save the output as a .html file?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://64612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-19 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found