On Fri, May 14, 2004 at 01:08:29PM +0100, Werner wrote:
> Hi There,
> 
> I've got a html page that uses the following:
> 
> <form action="people.cgi" METHOD="GET" name="form1" 
> enctype="multipart/form-data">
> 
> and would like to change the "GET" method to the "POST" method.
> 
> my current people.cgi looks like:
> 
> $temp=$ENV{'QUERY_STRING'};
> #read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
> @pairs=split(/&/,$temp);
> 
> foreach $item(@pairs)
> {
>         ($key,$content)=split (/=/,$item,2);
>          $content=~tr/+/ /;
>          $content=~ s/%(..)/pack("c",hex($1))/ge;
>          $fields{$key}=$content;
> }

Scrap all that code.  Its horribly outdated and broken.

use strict;
use CGI;

my $c = new CGI;
my %fields = ();

foreach my $name ($c->param) {
        $fields{$name} = $c->param($value);
} 

Hard to believe its 2004 and there is STILL code parsing the query
string itself.

> 
> what changes to I have to make to implement my variables using the "POST" 
> method.
> 
> Regards
> Werner
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 

-- 
Brad Lhotsky <[EMAIL PROTECTED]>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to