Re: FORM element requires ACTION attribute: problems with compatibility

At 10:06 AM 8/18/97 -0700, Walter Ian Kaye wrote:
>At 12:50p -0400 08/18/97, Greg Marr wrote:
> >
> > This made it extremely easy to write multi-pass cgi scripts, as they
didn't
> > need to know the URL that was used to call them.  They could just print
out
> > <FORM> or <FORM METHOD=POST> and the submission would go right back to the
> > same script.
>
>What does it mean, "multi-pass cgi script"? What does it mean, "submission
>would go right back to the same script"?

A single script that handles multiple forms, and uses some attribute of the
submitted information to distinguish between the forms.  This prevents the
need to have a different script for each form in a database application,
for example.

By "submission would go right back to the same script" I mean this:

http://www.bar.com/cgi-bin/foo.cgi creates the following page:

<HTML>
...
<FORM METHOD=POST>
...
<INPUT TYPE=SUBMIT NAME=FORM2 VALUE="Submit"> 
</FORM>

Because of the way <FORM> is specified in HTML 2.0 and 3.2, pressing the
submit button on this page submits the information to the same script,
http://www.bar.com/cgi-bin/foo.cgi.  The way HTML 4.0 currently specifies
FORM, thi s wouldn't work.

So why doesn't the script use ACTION=foo.cgi instead of just leaving it blank?
Simply put, it makes the script simpler.  Hardcoding a URL for submissions
would break the script if it were moved somewhere else, renamed, etc.  It
could determine what URL was used to call it, and figure out from this URL
what it needs to put in the ACTION attribute, but this is a lot less work.




--
Greg Marr
gregm@alum.wpi.edu
"We thought you were dead." 
"I was, but I'm better now." - Sheridan, "The Summoning"

Received on Monday, 18 August 1997 13:41:06 UTC