Re: FORM element requires ACTION attribute: problems with compatibility

Greg Marr (gregm@alum.wpi.edu)
Mon, 18 Aug 1997 13:43:43 -0400


Message-Id: <3.0.2.32.19970818134343.00950960@pop.ma.ultranet.com>
Date: Mon, 18 Aug 1997 13:43:43 -0400
To: www-html@w3.org
From: Greg Marr <gregm@alum.wpi.edu>
In-Reply-To: <v0310280cb01e312a2efc@[205.149.180.135]>
Subject: 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"