Leser: 1
![]() |
|< 1 2 3 4 5 6 >| | ![]() |
58 Einträge, 6 Seiten |
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
59
60
61
62
63
#! /usr/bin/perl
use CGI;
use warnings;
my $cgi = new CGI;
use CGI::Carp qw(fatalsToBrowser);
my @NeuerEintrag;
push ( @NeuerEintrag, "<!-- Eintrag [" . $cgi->param(Username) . "] -->\n" );
push ( @NeuerEintrag, "<table border=\"0\" width=\"40%\"><tr>\n" );
push ( @NeuerEintrag,
"<th>Name:</th><td>" . $cgi->param(Username) . "</td></tr>\n" );
push ( @NeuerEintrag,
"<tr><td colspan=\"2\">" . $cgi->param(Usertext) . "</td>\n" );
push ( @NeuerEintrag, "</tr></table>\n" );
my @Zeilen;
open( DATEI, "</homepages/18/d23090695/htdocs/eintrag.html" ) || die "Datei nicht gefunden!";
@Zeilen = <DATEI>;
close(DATEI);
my @NeueZeilen;
my $Zeile;
foreach $Zeile (@Zeilen) {
if ( $Zeile =~ /^<\!\-\- NEU \-\->$/ ) {
foreach (@NeuerEintrag) {
push ( @NeueZeilen, $_ );
}
push ( @NeueZeilen, "<!-- NEU -->\n" );
}
else {
push ( @NeueZeilen, $Zeile );
}
}
open( DATEI2, ">/homepages/18/d23090695/htdocs/eintrag.html" ) || die "Datei nicht gefunden!";
print DATEI2 @NeueZeilen;
close(DATEI2);
print "Content type: text/html\n\n";
print "<html><head></head><body>Erfolgreich</body></html>";
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
#! /usr/bin/perl
use CGI;
use warnings;
my $cgi = new CGI;
use CGI::Carp qw(fatalsToBrowser);
my $GaestebuchDatei = "/homepages/18/d23090695/htdocs/eintrag.html";
my @NeuerEintrag =
(
"<!-- Eintrag [" . $cgi->param(Username) . "] -->\n",
"<table border=\"0\" width=\"40%\"><tr>\n",
"<th>Name:</th><td>" . $cgi->param(Username) . "</td></tr>\n",
"<tr><td colspan=\"2\">" . $cgi->param(Usertext) . "</td>\n",
"</tr></table>\n",
);
open( DATEI, $GaestebuchDatei ) or die "Datei nicht gefunden!";
my @Zeilen = <DATEI>;
close(DATEI);
my @NeueZeilen;
foreach my $Zeile (@Zeilen) {
if ( $Zeile =~ /^<\!\-\- NEU \-\->$/ ) {
push (@NeueZeilen, @NeuerEintrag, "<!-- NEU -->\n" );
}
else {
push ( @NeueZeilen, $Zeile );
}
}
open( DATEI2, ">$GaestebuchDatei" ) or die "Datei nicht gefunden!";
print DATEI2 @NeueZeilen;
close(DATEI2);
print "Content type: text/html\n\n";
print "<html><head></head><body>Erfolgreich</body></html>";
if ( $Zeile =~ /^<\!\-\- NEU \-\->\r?$/ ) {
1
2
3
4
5
6
7
8
my @NeuerEintrag =
(
"<!-- Eintrag [" . &CGI::escapeHTML($cgi->param(Username)) . "] -->\n",
"<table border=\"0\" width=\"40%\"><tr>\n",
"<th>Name:</th><td>" . &CGI::escapeHTML($cgi->param(Username)) . "</td></tr>\n",
"<tr><td colspan=\"2\">" . &CGI::escapeHTML($cgi->param(Usertext)) . "</td>\n",
"</tr></table>\n",
);
1
2
3
4
5
if (Username ne "" && Usermail ne "" && Usertext ne "") {
# Hier alles was er machen soll, wenn keins der felder leer #ist...
}
![]() |
|< 1 2 3 4 5 6 >| | ![]() |
58 Einträge, 6 Seiten |