diff -r 2f11b54a69fe -r 73d827714711 htdocs/cgi-bin/receive --- a/htdocs/cgi-bin/receive Tue Feb 05 08:05:54 2013 +0100 +++ b/htdocs/cgi-bin/receive Tue Feb 05 14:01:36 2013 +0100 @@ -4,6 +4,7 @@ use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser); +use Net::SCP; my ( $Daten, $value, $name, $text, $anhang, $input, @@ -12,7 +13,6 @@ my %Formular; my @Formularfelder; -#$anhang = $ENV{'QUERY_STRING'}; read( STDIN, $Daten, $ENV{'CONTENT_LENGTH'} ); print $Daten; &verarbeiten; @@ -21,9 +21,12 @@ @Formularfelder = split( /&/, $Daten ); foreach my $Feld (@Formularfelder) { ( $name, $value ) = split( /=/, $Feld ); - $value=~ s/\<26\>/&/; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + $value =~ s/\<3D\>/\=/g; + $value =~ s/\<25\>/\%/g; + $value =~ s/\<2B\>/\+/g; + $value =~ s/\<26\>/\&/g; $Formular{$name} = $value; } } @@ -37,15 +40,29 @@ # Folgend Test-Script -open OUT,">test"; -print OUT "\@schluessel: @schluessel\n\@werte: @values\n\n"; -print OUT $Daten; +if ($Formular{req} ne ''){ + open (OUT, ">$uid.pem"); + print OUT "$Formular{req}"; + close OUT; +} + +open OUT,">$uid"; +print OUT "\@schluessel:\t=\t\@werte:\n"; +print OUT "------------\t\t-------\n\n"; +for(my $x=0;$x<=$#schluessel;$x++){ +print OUT "$schluessel[$x]\t\t=\t$values[$x]\n"; +} close OUT; +my $scp=Net::SCP->new(); +$scp->scp($uid,'root@192.168.0.138:/var/www/download/'); +system ("rm $uid"); +system ("rm $uid.pem"); +__END__ + # Test -$uid=$uid.'.html'; my $x=0; -open( OUT, ">/var/www/$uid" ); +open( OUT, ">/var/www/$uid.html" ); print OUT ( ' CGI-Feedback

CGI-Feedback vom Programm recieve

' @@ -60,6 +77,3 @@ } print OUT (''); close OUT; -sleep(180); -system "rm /var/www/$uid"; -__END__