Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] whats wrong?

Expand Messages
  • Gregory D. Fox
    If this code is to parse data from a web form you should use: use CGI qw (:standard); use CGI::Carp qw(fatalsToBrowser); This is from the CGI.pm module, which
    Message 1 of 2 , May 21 3:44 AM
    • 0 Attachment

      If this code is to parse data from a web form you should use:

       

      use CGI qw (:standard);

      use CGI::Carp qw(fatalsToBrowser);

       

      This is from the CGI.pm module, which comes stand with Perl.

       

      This will handle the dirty work.

       

      Go to: http://stein.cshl.org/WWW/software/CGI/cgi_docs.html for more info.

       

      Gregory D. Fox - Liberty Computer Solutions/Liberty Marketing - (401) 823-5252/Fax: (401) 828-7057

      <Greg@...> <www.libertymarketing.com>

      Web Site Hosting - Web Site Design - Perl/CGI Programming

      <>< <>< <>< <>< <>< ><> ><> ><> ><>

      ><><> ><> ><> ><> ><>

      Need an ecommerce solution? Check out: http://ecommercecart.com

      <>< <>< <>< <>< <>< ><> ><> ><> ><>

      ><><> ><> ><> ><> ><>

       

      -----Original Message-----
      From: Sujit Kirpekar [mailto:kirpekar@...]
      Sent: Sunday, May 21, 2000 4:07 AM
      To: perl-beginner@egroups.com
      Subject: [PBML] whats wrong?

       

      Could someone tell me whats wrong with this piece.. It's not returing any values:

       


      # Get the input
      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

       

      # Split the name-value pairs
      @pairs = split(/&/, $buffer);

       

      foreach $pair (@pairs) {
         ($name, $value) = split(/=/, $pair);

       

         # Un-Webify plus signs and %-encoding
         $value =~ tr/+/ /;
         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
         $value =~ s/<!--(.|\n)*-->//g;

       

         if ($allow_html != 1) {
            $value =~ s/<([^>]|\n)*>//g;
         }

       

         $FORM{$name} = $value;
      }



    Your message has been successfully submitted and would be delivered to recipients shortly.