|< 1 2 3 >| | 23 Einträge, 3 Seiten |
Gast+2008-05-19 09:20:41--Kann jemand sagen woran das liegen könnte?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!C:/Program Files/Perl/bin/perl
use Net::SMTP;
use MIME::Lite;
my $Label;
my $TmpAdressTo;
my $TmpEmailAddressTo;
print FILE "\n********************** NEW RECORD ************************\n";
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($allow_html != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
$FORM{$name} = $value;
if ($name ne 'Submit')
{
print FILE $name;
print FILE "=";
print FILE $value;
print FILE "\n";
print HTMLFILE "<TR>\n";
print HTMLFILE "<TD>";
print HTMLFILE $name;
print HTMLFILE "</TD>\n";
print HTMLFILE "<TD>";
print HTMLFILE $value;
print HTMLFILE "</TD>\n";
print HTMLFILE "</TR>\n";
}
}
print HTMLFILE "</TABLE>";
print HTMLFILE "</BODY>";
print HTMLFILE "</HTML>";
close (FILE);
close (HTMLFILE);
my $emaillinks;
my $emailrechts;
($emaillinks, $emailrechts) = split(/@/, $email);
$cc_address = $emaillinks."\@".$emailrechts;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($allow_html != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
$FORM{$name} = $value;
if ($name ne 'Submit')
{
print FILE $name;
print FILE "=";
print FILE $value;
print FILE "\n";
print HTMLFILE "<TR>\n";
print HTMLFILE "<TD>";
print HTMLFILE $name;
print HTMLFILE "</TD>\n";
print HTMLFILE "<TD>";
print HTMLFILE $value;
print HTMLFILE "</TD>\n";
print HTMLFILE "</TR>\n";
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use CGI; my %FORM = CGI::Vars(); if( $allow_html != 1 ){ for my $key ( keys %FORM ){ $FORM{$key} =~ s/<([^>]|\n)*>//g; } } while( my ($key,$value) = each %FORM ){ next if( $key eq 'Submit' ); print FILE $key, "=", $value, "\n"; print HTMLFILE "<tr>\n<td>$key</td>\n<td>$value</td>\n<tr>\n"; }
Gast+2008-05-21 11:43:56--ich habe den Code ausprobiert und muß sagen, daß in dem File kein Text drinsteht.
Was mache ich falsch?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
rbaecker@www-devel-rbaecker ~ $ cd community/
rbaecker@www-devel-rbaecker ~/community $ ll
total 0
rbaecker@www-devel-rbaecker ~/community $ vi cgi.pl
rbaecker@www-devel-rbaecker ~/community $ cat cgi.pl
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
open FILE, '>', 'test.out' or die $!;
open HTMLFILE, '>', 'test2.out' or die $!;
my %FORM = CGI::Vars();
my $allow_html = 0;
if( $allow_html != 1 ){
for my $key ( keys %FORM ){
$FORM{$key} =~ s/<([^>]|\n)*>//g;
}
}
while( my ($key,$value) = each %FORM ){
next if $key eq 'Submit';
print FILE $key, "=", $value,"\n";
print HTMLFILE "<tr>\n<td>$key</td>\n<td>$value</td>\n</tr>\n";
}
rbaecker@www-devel-rbaecker ~/community $ perl cgi.pl test=1 hallo=2 mein_test=3 perl=community
rbaecker@www-devel-rbaecker ~/community $ ll
total 12
-rw-rw-r-- 1 rbaecker rbaecker 468 2008-05-21 11:55 cgi.pl
-rw-rw-r-- 1 rbaecker rbaecker 158 2008-05-21 11:56 test2.out
-rw-rw-r-- 1 rbaecker rbaecker 42 2008-05-21 11:56 test.out
rbaecker@www-devel-rbaecker ~/community $ cat test.out
perl=community
test=1
mein_test=3
hallo=2
rbaecker@www-devel-rbaecker ~/community $ cat test2.out
<tr>
<td>perl</td>
<td>community</td>
</tr>
<tr>
<td>test</td>
<td>1</td>
</tr>
<tr>
<td>mein_test</td>
<td>3</td>
</tr>
<tr>
<td>hallo</td>
<td>2</td>
</tr>
1
2
3
4
5
6
7
rbaecker@www-devel-rbaecker ~/community $ perl cgi.pl test=test%40example.de
rbaecker@www-devel-rbaecker ~/community $ cat test2.out
<tr>
<td>test</td>
<td>test@example.de</td>
</tr>
rbaecker@www-devel-rbaecker ~/community $
|< 1 2 3 >| | 23 Einträge, 3 Seiten |