Leser: 1
10 Einträge, 1 Seite |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title><"Ergebnis von auth.log"></title>
</head>
<body>
<h1>Tabelle für die Datei auth.log</h1>
<table border="1">
<caption>Assoziationen</caption>
<tr>
<th>Monat</th>
<th>Tag</th>
<th>Zeit</th>
<th>Host</th>
<th>Dienst</th>
<th>Meldung</th>
</tr>
<TMPL_LOOP NAME="data">
<tr>
<td>TPMPL_VAR NAME="monat"</td>
<td>TPMPL_VAR NAME="tag"</td>
<td>TPMPL_VAR NAME="zeit"</td>
<td>TPMPL_VAR NAME="host"</td>
<td>TPMPL_VAR NAME="dienst"</td>
<td>TPMPL_VAR NAME="meldung"</td>
</tr>
</TMPL_LOOP>
</table>
</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
#!/usr/bin/perl -w
use strict;
use DBI;
use HTML::Template;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# Datenbankdaten und Verbindung zur DB herstellen
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# Datenbank
my $datenbank = "info";
# Datenbankhost
my $datenbankhost = "127.0.0.1";
# Datenbankusername
my $datenbankuser = "root";
# Datenbankpasswort
my $datenbankpw = "";
my $dbh = DBI->connect("DBI:mysql:$datenbank:$datenbankhost","$datenbankuser","$datenbankpw")
or die "Fehler bei der Datenbankverbindung aufgetreten.";
my $sth = $dbh->prepare('select Monat, Tag, Zeit, Host, Dienst, Meldung
from infotable');
$sth->execute();
my $rows;
push @{$rows}, $_ while $_ = $sth->fetchrow_hashref();
my $template = HTML::Template->new(filename => 'template1.html');
$template->param(data => $rows);
print $template->output();
$dbh->disconnect();
1
2
3
[Sat Jan 13 21:40:45 2007] [error] [client 127.0.0.1] HTML::Template->output() : fatal error in loop output : HTML::Template : Attempt to set nonexistent parameter 'meldung' - this parameter name doesn't match any declarations in the template file : (die_on_bad_params => 1) at /usr/local/share/perl/5.8.8/HTML/Template.pm line 2997
[Sat Jan 13 21:40:45 2007] [error] [client 127.0.0.1] at /opt/lampp/htdocs/xampp/testperl.pl line 38
[Sat Jan 13 21:40:45 2007] [error] [client 127.0.0.1] Premature end of script headers: testperl.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
[EMAIL=you@example.com]you@example.com[/EMAIL] and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.3 (Unix) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d PHP/5.2.0 mod_apreq2-20051231/2.5.7 mod_perl/2.0.2 Perl/v5.8.7 Server at localhost Port 80</address>
</body></html>
1
2
3
[Sat Jan 13 22:21:45 2007] [error] [client 127.0.0.1] HTML::Template->output() : fatal error in loop output : HTML::Template : Attempt to set nonexistent parameter 'meldung' - this parameter name doesn't match any declarations in the template file : (die_on_bad_params => 1) at /usr/local/share/perl/5.8.8/HTML/Template.pm line 2997
[Sat Jan 13 22:21:45 2007] [error] [client 127.0.0.1] at /opt/lampp/htdocs/xampp/testperl.pl line 38
[Sat Jan 13 22:21:45 2007] [error] [client 127.0.0.1] Premature end of script headers: testperl.pl
1
2
3
4
5
6
<td>TPMPL_VAR NAME="monat"</td>
<td>TPMPL_VAR NAME="tag"</td>
<td>TPMPL_VAR NAME="zeit"</td>
<td>TPMPL_VAR NAME="host"</td>
<td>TPMPL_VAR NAME="dienst"</td>
<td>TPMPL_VAR NAME="meldung"</td>
<TMPL_VAR NAME="monat">
$cgi->header();
10 Einträge, 1 Seite |