#!/usr/bin/perl ############################################ # select.cgi # Emission Control - Filter Selection Guide # Dale Burmester March 25th,2001 # updated Jan 27, 2003 ############################################ &parse_form; &return_html; sub parse_form { # filter type is after the ? passed from .html $filter = "$ENV{QUERY_STRING}"; # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs){ ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # If they try to include server side includes, erase them, so they # arent a security risk if the html gets returned. Another # security hole plugged up. $value =~ s///g; # Create two associative arrays here. One is a configuration array # which includes all fields that this form recognizes. The other # is for fields which the form does not recognize and will report # back to the user in the html return page and the e-mail message. # Also determine required fields. if ($name eq 'recipient' || $name eq 'coordinates' || $name eq 'coordinates.x' || $name eq 'coordinates.y' || $name eq 'open.x' || $name eq 'open.y' || $name eq 'filter' || $name eq '1filter' || $name eq 'dw' || $name eq '1dw' || $name eq 'phase' || $name eq 'mounting' || $name eq 'standards' || $name eq '1mounting' || $name eq 'B1' || $name eq 'type' || $name eq 'feed' || $name eq 'current' || $name eq 'voltage' || $name eq 'fuses' || $name eq 'switch' || $name eq 'vselect' || $name eq 'connections' || $name eq 'terminations' || $name eq 'class' || $name eq 'mounting' || $name eq 'subject' || $name eq 'email' || $name eq 'realname' || $name eq 'redirect' || $name eq 'bgcolor' || $name eq 'background' || $name eq 'link_color' || $name eq 'vlink_color' || $name eq 'text_color' || $name eq 'title' || $name eq 'return_link_title' || $name eq 'return_link_url') { $CONFIG{$name} = $value; } elsif ($name eq 'required') { @required = split(/,/,$value); } elsif ($name eq 'env_report') { @env_report = split(/,/,$value); } else { if ($FORM{$name}) { $FORM{$name} = "$FORM{$name}, $value"; } else { $FORM{$name} = $value; } } } } ####################### sub return_html { print "Content-type: text/html\n\n"; print "\n
\n"; print "
emission control, ltd.
|
Emission Control Powerline Filter Products
Filter Selection Guides
Frequently Asked Questions RoHS Compliance Tech Notes Conducted EMI Testing Contact Us |
print " "; print " |