whatever.... it gets text where it needs to go... and if all you need is
text the form parser below is fine.. also...if your not offering any
real help...maybe you can keep your comments to yourself :)
I hate people who answer questions with no or you cant do that or
the like..it freakin lame...maybe you could tell him why you think this
form parser is broken and actully really help someone...ok
so maybe stop being so freakin cool for just a sec and try to help

On Thu, 2003-01-30 at 05:19, Todd W wrote:
> "Jdavis" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > i have not been following this thread...but it appears as if you just
> > want a generic cgi scrip to work...I like to use  &ReadParse for
> > most of my easy cgi interactions ...heer is a example..
> >
> 
> <snip />
> 
> Do not use. Broken form parameter parser below:
> 
> > #!/usr/bin/perl
> >
> > &ReadParse;
> >
> > print "$in{email}\n";
> >
> > #all you need to do is paste this at the bottom
> > # of your cgi scrip and refer to the form vars by
> > #ther name using the method above...
> >
> > # Adapted from cgi-lib.pl by [EMAIL PROTECTED]
> >     # Copyright 1994 Steven E. Brenner
> >     sub ReadParse {
> >       local (*in) = @_ if @_;
> >       local ($i, $key, $val);
> >
> >       if ( $ENV{'REQUEST_METHOD'} eq "GET" ) {
> >     $in = $ENV{'QUERY_STRING'};
> >       } elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
> >     read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
> >       } else {
> >         # Added for command line debugging
> >         # Supply name/value form data as a command line argument
> >         # Format: name1=value1\&name2=value2\&...
> >         # (need to escape & for shell)
> >         # Find the first argument that's not a switch (-)
> >         $in = ( grep( !/^-/, @ARGV )) [0];
> >         $in =~ s/\\&/&/g;
> >       }
> >
> >       @in = split(/&/,$in);
> >
> >       foreach $i (0 .. $#in) {
> >     # Convert plus's to spaces
> >     $in[$i] =~ s/\+/ /g;
> >
> >     # Split into key and value.
> >     ($key, $val) = split(/=/,$in[$i],2); # splits on the first =.
> >
> >     # Convert %XX from hex numbers to alphanumeric
> >     $key =~ s/%(..)/pack("c",hex($1))/ge;
> >     $val =~ s/%(..)/pack("c",hex($1))/ge;
> >
> >     # Associate key and value. \0 is the multiple separator
> >     $in{$key} .= "\0" if (defined($in{$key}));
> >     $in{$key} .= $val;
> >       }
> >       return length($in);
> >     }
> >
> >
> <snip />
> 
> Todd W.
-- 
jd
[EMAIL PROTECTED]

Bad spellers of the world untie!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to