displaying .html file as the result

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi, I hope this isn't too dumb of a question. How can I get my Perl
CGI script to display a flat HTML file (in fact, the same HTML file)
after the submit button has been clicked? Basically I have a flat HTML
file with a small form in it; I want the same page to redisplay after
the user has submitted.


Re: displaying .html file as the result

Quoted text here. Click to load it

You could issue a $cgi->redirect to that page.  Or you could just
read the page from disk and print it to the browser:

print $cgi->header(), `cat foo.html`;

(If the page is very big, you might want to print it in chunks instead.)

-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Site Timeline