edatz
03-28-2011, 04:58 PM
Hi, just a quick question. I use the below to parse an SSI query to a flat file database.
if ($ENV{'QUERY_STRING'}) {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair); # Do need this
# do I really need these for the SSI query? Works without them (shoulder shrug)
#$value =~ tr/+/ /;
#$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
#$value =~ s/<!--(.|n)*-->//g;
#$value =~ s/<([^>]|n)*>//g;
$FORM{$name} = $value; # Do need this
} # end foreach
} # end if env
my SSIs look like this:
<!--#include virtual="/cgi-bin/aaaa/script.pl?action=thisent&id=20110328203439" -->
I've tried running it without various bits (now commented out) and everything still runs okay in various browsers.
Normally I'd use those when processing forms, but this not a form, more like parsing an SSI like it is a form.
So I guess I don't really need those to do the job. Yes?
Any thoughts?
if ($ENV{'QUERY_STRING'}) {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair); # Do need this
# do I really need these for the SSI query? Works without them (shoulder shrug)
#$value =~ tr/+/ /;
#$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
#$value =~ s/<!--(.|n)*-->//g;
#$value =~ s/<([^>]|n)*>//g;
$FORM{$name} = $value; # Do need this
} # end foreach
} # end if env
my SSIs look like this:
<!--#include virtual="/cgi-bin/aaaa/script.pl?action=thisent&id=20110328203439" -->
I've tried running it without various bits (now commented out) and everything still runs okay in various browsers.
Normally I'd use those when processing forms, but this not a form, more like parsing an SSI like it is a form.
So I guess I don't really need those to do the job. Yes?
Any thoughts?