|
1 #!/usr/bin/perl |
|
2 |
|
3 use strict; |
|
4 use warnings; |
|
5 use CGI; |
|
6 use CGI::Carp qw(fatalsToBrowser); |
|
7 |
|
8 my ($Daten, $value,$name, $text,$anhang,$input,$q,$key,$wert,$param,%result); |
|
9 my $i=0; |
|
10 my %Formular; |
|
11 my @Formularfelder; |
|
12 |
|
13 |
|
14 $anhang= $ENV{'QUERY_STRING'}; |
|
15 read(STDIN, $Daten, $ENV{'CONTENT_LENGTH'}); |
|
16 &verarbeiten; |
|
17 sub verarbeiten { |
|
18 @Formularfelder = split(/&/, $Daten); |
|
19 foreach my $Feld (@Formularfelder) { |
|
20 ($name, $value) = split(/=/, $Feld); |
|
21 $value =~ tr/+/ /; |
|
22 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; |
|
23 $Formular{$name} = $value; |
|
24 } |
|
25 } |
|
26 my @schluessel=keys(%Formular); |
|
27 @schluessel=reverse @schluessel; |
|
28 my @values=values(%Formular); |
|
29 @values=reverse @values; |
|
30 open (OUT,">test"); |
|
31 print OUT ("\@schluessel: @schluessel\n\@values: @values\n"); |
|
32 close OUT; |
|
33 # Folgend SSL-Script |
|
34 |
|
35 # Test |
|
36 my $x=0; |
|
37 open (OUT,">/var/www/index.html"); |
|
38 print OUT ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"><head> |
|
39 <title>CGI-Feedback</title><body><h1>CGI-Feedback vom Programm <i>recieve</i></h1>'); |
|
40 foreach (@schluessel){ |
|
41 print OUT ('<p><B>Feldname: </B>'.$schluessel[$x].' <B> Inhalt: </B>'.$values[$x].'<br>'); |
|
42 $x++; |
|
43 } |
|
44 print OUT ('</body></html>'); |
|
45 close OUT; |