Re: Web Page Forms

Stephen Boyd Gowing (sbg@nospam.fox-in.socs.uts.edu.au)
Tue, 7 Nov 1995 14:23:00 +1100 (EST)

On Tue, 7 Nov 1995, Stuart Reid wrote:

> Hiya All,
>
> I was wondering if anyone out there would be able to tell me how I can
> format my form from my Web page, so that the reply doesn't look like this
> example:
>
> name=blah&address=Something@nospam.blah.blah&choice=Loved+It&extra=No+go+away

You can't. That's what they look like.

You need to process it in your cgi script or whatever. In perl for example:

$query = $ENV{'QUERY_STRING'};
read(STDIN, $query, $ENV{'CONTENT_LENGTH'})
if ($ENV{'REQUEST_METHOD'} eq "POST");
@nospam.pairs = split($ENV{/&/, $query);
for (@nospam.pairs) {
( $key, $value ) = split(/=/);
$value = s/\+/ /g;
$value = s/%(..)/pack("c",hex($1))/ge;
$FORM{$key} = $value;
}

and then you've got an associative array (%FORM) holding the values from
the fields in your form.

There's probably a more obscure way to do this.

sbg