> can you review this script and see if you can spot any errors? > no errors appear in the log, but the lines that are NOT quoted do not process correctly > > > > Chris > -----Original Message----- > From: Chris klein [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 01, 2002 10:07 AM > To: Klein, Christopher > Subject: > > > #! /usr/bin/perl > > print "Content-type: text/html\n\n"; > print "<H2><U>Decoding the query string</U></H2>"; > > $minobs=0; > $file="/usr/local/www/cgi-bin/wva/testing"; > open(SUBMISSION, ">$file") || die "Can't open newfile: $! \n"; > $webpage="/usr/local/www/data/upload/page2a.html"; > open(PAGE2, ">$webpage") || die "Can't open newfile: $! \n"; > #open(NAMES, "/usr/local/www/data/upload/wvahosps.txt") || die "can't open > data file"; > #while (<NAMES>) { > # ( $num, $name )= split(' ', $_, 2); > # $realid($num) = $name; > #} > #close NAMES; > open(INPIPE, "date |"); > $today = <INPIPE>; > close(INPIPE); > > #Getting the input > if ( $ENV{REQUEST_METHOD} eq 'GET' ){ > $inputstring=$ENV{QUERY_STRING}; > } > else { > read(STDIN, $inputstring, $ENV{'CONTENT_LENGTH'}); > } > > #print "<B>Before decoding:</B><BR>"; > #print "<H3>$inputstring</H3>"; > > # Replace + signs with spaces > $inputstring =~ tr/+/ /; > > #Decoding the hexadecimal characters > $inputstring =~ s/%(..)/pack("C", hex($1))/ge; > > # After decoding %xy > #print "-" x 80, "<BR>"; > #print "<B>After decoding <I>%xy</I>:</B>"; > #print "<H3>$inputstring</H3>"; > > # Extracting the & and = to create key/value pairs > @key_value=split(/&/, $inputstring); > foreach $pair ( @key_value){ > ($key, $value) = split(/=/, $pair); > $input{$key} = $value; # Creating a hash to save the data > } > > if ($inputstring{numobs} < $minobs ) { print '<a href="https://wva.s-3.net/upload/error1.html">there was an error, click here for details </a>'; } > > #elsif ($inputstring{provid} ne $num) {print '<META HTTP-EQUIV="refresh" > CONTENT="7; url=https://wva.s-3.net/upload/error1.html">';} > else { > > # After decoding > #print "-" x 80, "<BR>"; > #print "<B>After decoding + and &:</B>"; > while(($key, $value) = each(%input) ){ > # Printing the contents of the hash > print SUBMISSION "$key: $value \n"; > } while(){ chomp($num=$provid); last unless $num; print SUBMISSION $realid{$num}, "\n"; } > print SUBMISSION $today ; > > #creating dynamic web page > print PAGE2 "<html>\n<head>\n<title>results</title>\n"; > print PAGE2 '<meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1">'; > print PAGE2 "</head>\n\n"; > print PAGE2 '<body bgcolor="#FFFFFF">', "\n"; > > while(($key, $value) = each(%input) ){ > # Printing the contents of the hash > print PAGE2 "$key: $value \n "; > } while(){ chomp($num=$provid); last unless $num; print PAGE2 $realid{$num}, "\n"; } > print PAGE2 $today ; > > print PAGE2 "\n\n\n\n" ; > print PAGE2 '<form name="verify" > action="https://wva.s-3.net/cgi-bin/fupload.cgi" method="post">'; > print PAGE2 "\n"; > print PAGE2 '<p>is this information correct?</p>'; > print PAGE2 "\n"; > print PAGE2 '<p> </p>'; > print PAGE2 "\n"; > print PAGE2 '<p><input type="submit" name="Yes" value="Submit"></p>'; > print PAGE2 "\n"; > print PAGE2 '</form>'; > #print "<B>Now what do we want to do with this information?"; > #print '<META HTTP-EQUIV="refresh" CONTENT="7; > url=https://wva.s-3.net/upload/page2.html">'; > > print '<a href="https://wva.s-3.net/upload/page2a.html">done, click here > to continue </a>'; > }
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]