Hi Michael, 

thanks for taking the time to answer. The reason I would like to work 
this way (access a cgi script as an SSI within an html file) is 
because I am using a templating system (Mason) to develop a web site, 
but the production site will not be able to use Mason, so I have a 
script that requests each page from the (Mason) server and saves the 
html files served up. I then transfer those files to the production 
server. Mason spits out the file with the <!--#exec cgi="/cgi-
bin/nb.cgi" --> directive intact (i.e. the SSI is not activated), but 
on the production server, the SSI _is_ activated. 

Although the html file is static html, I was very pleased when I 
discovered I could use the "exec cgi=" SSI directive with GET 
requests including parameters (GET page.html?key1=val1&key2=val2) and 
the server would pass these along to my script. 

So I happily developed my scripts using GET methods in my forms, 
until I wanted to change to POSTing, and suddenly it doesn't work. 

I am working around it now by providing basic (non-templated) forms 
whenever I want to use POSTs. I don't want to use print statements in 
my cgi scripts to generate the main html of my template, because that 
would negate the advantages of using a flexible templating system - 
I'd have to manually update the script every time the html template 
changes. 

Another (largely theoretical, but still...) advantage is that my 
links are technology independent (as per W3C recommendations) - 
theoretically, at some date in the future I could change from using 
Perl scripts in a cgi-bin directory (perish the thought) to some 
other technology, without having to change the links seen by the 
outside world. And my links always mean something (they are directly 
related to the section of the site you are in), rather than being 
artificially separated from the rest of the hierarchy in a cgi-bin of 
their own. 

So if anyone knows how a script could pick up the parameters of a 
POST request to a static html file it'd be a neat trick. Mason does 
it, but I think it works via mod_perl magic. I have permissions to 
write .htaccess Apache configuration files on the production server, 
but it doesn't run mod_perl. 

David.


On 4 Apr 2002, at 12:55, Michael Kelly wrote:

> On 4/4/02 9:16 AM, David R. Baird <[EMAIL PROTECTED]> wrote:
> 
> Hi David,
> 
> > I have cgi script that is INCLUDEd in a web page:
> > 
> > page.html:
> > 
> > <html><head></head><body>
> > 
> > <!--#exec cgi="/cgi-bin/nb.cgi" -->
> > 
> > </body></html>
> > 
> > The script prints out a form. When the form's method attribute is GET ie
> 
> > <form method="post" action="page.html">
> 
> I assume you mean 'method="get"' here.
> 
> > , it works fine, but I want to process
> > a password, so I need to POST to page.html When I do, I get a 405 error:
> > 
> > The requested method POST is not allowed for the URL /page.html.
> > 
> > Is there any way I can POST to a .html URL? I am running Apache/1.3.20 Server
> > on Win 98. 
> 
> How would that work? HTML are simply text files that are formatted by the
> browser. How would they process arguments? If you're trying to post to an
> ..html file, which is static, you may as well just link. If you want to send
> a user to a static HTML page after you process their posted data, just use a
> redirect header, or print out your HTML with the script that processes the
> data.
> 
> If you have a Perl script with a .html, posting to a ".html" file is not
> your largest problem.
> 
> I notice that you're including the output of a Perl script in your HTML, but
> that makes no difference. It's still HTML, it's just being parsed for SSI.
> Since the static HTML in your example is so minimal, why not just add a few
> extra 'print's so your script and point the form to it?
> 
> hth,
> -- 
> Michael
> 
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to