KrYo has asked for the wisdom of the Perl Monks concerning the following question:
But i cannot distinguish each form-input... how do i get a name for each element. I would like it to be something like--------------------------------------------------- read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/&/&/g; $value =~ s/"/"/g; $value =~ s/</</g; $value =~ s/>/>/g; $FORM{$name} = $value; } ---------------------------------------------------- Then i loop all the form-element that is submitted like... ----------------------------------------- foreach $key (keys %FORM) { print "Want to save : [$FORM{$key}]<br>\n"; } -----------------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Generic Form thingy
by turnstep (Parson) on Mar 29, 2000 at 19:00 UTC | |
|
Re: Generic Form thingy
by chromatic (Archbishop) on Mar 29, 2000 at 20:28 UTC | |
|
Re: Generic Form thingy
by btrott (Parson) on Mar 29, 2000 at 22:03 UTC | |
|
RE: Generic Form thingy
by Anonymous Monk on Mar 29, 2000 at 22:16 UTC | |
by KrYo (Initiate) on Mar 30, 2000 at 12:36 UTC |