Re: Forms support in clients

Christian L. Mogensen (mogens@CS.Stanford.EDU)
Sun, 25 Sep 1994 07:38:24 +0100

Brian Behlendorf writes:

> I don't understand what you're trying to do. If you're trying to give
> names to the variables in a form, doesn't the NAME tag do that already?
> Or are you trying to place some sort of default text in the text entry
> field (which can be done using VALUE)?

No - he wants documents that can be more like programs. basically he
wants to display the form, have the user fill in what doc he
would like (as an example) and then have the browser do a text
substitution on the ACTION part before performing the GET.

The current requires-no-changes way is to use a script for this
which accepts two parameters and issues a redirect for them.

#!/usr/bin/perl-off-the-top-of-my-head

$Q= $ENV{'QUERY_STRING'};
@VARS= split(/&/, $Q);
foreach(@VARS) { ($KEY, $VAL)= split(/=/,$_,2); $VAR{$KEY}=$VAL; }
print "Location: $base$VAR{'doc'}?$VAR{'sstr'}\r\n\r\n";
print "Document has moved <A HREF=\"$base$VAR{'doc'}?$VAR{'sstr'}\"here</A>";
print "\n";

You might sling a URI header in there for good measure.
This would be used with the form below, using NAME instead of ID
and an ACTION pointing to the script...

> On Sat, 24 Sep 1994, Gavin Nicol wrote:
> > <FORM ACTION="http://foo/$doc?$sstr" METHOD=GET>
> > <INPUT TYPE="text" ID="sstr" NAME="Search string" MAXLENGTH=80><P>
> > <INPUT TYPE="text" ID="doc" NAME="Document Name" MAXLENGTH=80><P>
> > <INPUT TYPE="submit" NAME="Send Request">
> > </FORM>
> > </BODY>