equal
deleted
inserted
replaced
|
1 #!/usr/bin/perl |
|
2 |
|
3 use warnings; |
|
4 use strict; |
|
5 use LWP::UserAgent; |
|
6 use CGI; |
|
7 use CGI::Carp qw(fatalsToBrowser); |
|
8 |
|
9 my ($cgi, $firma, $mail, $text, $url, $ua, $req); |
|
10 $cgi = new CGI; |
|
11 |
|
12 # Auswerten der Daten. |
|
13 $firma=$cgi->param('AnwenderName'); |
|
14 $text=$cgi->param('Kommentartext'); |
|
15 open(TEST,">test"); |
|
16 print TEST ("$firma ;:; $text"); |
|
17 close TEST; |
|
18 my @Feldnamen = $cgi->param(); |
|
19 |
|
20 print $cgi->header(), |
|
21 $cgi->start_html(-head=>$cgi->meta({-http_equiv=>'REFRESH',-content=>'5;URL=http://192.168.0.144/index.html'})),$cgi->title('CGI-Feedback'), |
|
22 $cgi->h1('CGI-Feedback vom Programm ',$cgi->i('send')); |
|
23 foreach my $Feld (@Feldnamen) { |
|
24 print $cgi->strong('Feldname: '), |
|
25 $Feld, |
|
26 $cgi->strong(', Inhalt: '), |
|
27 $cgi->param($Feld), "<br>"; |
|
28 } |
|
29 print $cgi->end_html(); |
|
30 |
|
31 |
|
32 $url='http://192.168.0.144/cgi-bin/recieve'; |
|
33 |
|
34 $ua=LWP::UserAgent->new; |
|
35 $ua->env_proxy; |
|
36 $ua->timeout(10); |
|
37 |
|
38 $req=HTTP::Request->new("POST",$url); |
|
39 $req->header('Content-Type' => 'text/html'); |
|
40 $req->content("Name=$firma&Mail=$text"); |
|
41 |
|
42 $ua->request($req); |