Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

(Ovid - cargo-cult CGI) Re: Re: subparseform.lib

by Ovid (Cardinal)
on Apr 28, 2001 at 03:58 UTC ( [id://76315]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        if ($ENV{'REQUEST_METHOD'} eq 'GET') {
            @pairs = split(/&/, $ENV{'QUERY_STRING'});
    ...
        } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
            read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
            @pairs = split(/&/, $buffer);
    
  2. or download this
            ## REMOVE poison NULL 
            $key =~ s/\0//g;
    ...
            my $allowedCHARS = 'a-zA-Z0-9\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\
    +;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~';
            $key =~ s/[^$allowedCHARS]//gi;
            $value =~ s/[^$allowedCHARS]//gi;
    
  3. or download this
            $key =~s/<!--(.|\n)*-->//g;
    
  4. or download this
    ###=== Begin Cosmetic/Functionality addition ========
            ## REMOVE LEADING BLANKS
    ...
            ## REMOVE TRAILING BLANKS
            $key =~ s/\s*$//;
    ###=== End Cosmetic/Functionality addition ==========
    
  5. or download this
            if ($formdata{$key}) {
                $formdata{$key} .= ", $value";
            } else {
                $formdata{$key} = $value;
            }
    
  6. or download this
    my @values = split /, /, $formdata{ $somekey };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://76315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found