Hallo,
was ist an dem Code nur falsch. Bekomme immer den Error, obwohl es mal so ging (zumindest fast so). Ich hab dann was geändert und dann wieder zurückgeändert und jetzt geht's nimmer.
Danke
Sven
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
64
65
66
67
68
69
70
use strict;
use DBI;
use DBD::mysql;
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
my $dbh = DBI->connect("DBI:mysql:x", "x", "x", {RaiseError => 1});
my $sth = $dbh->prepare("SELECT * FROM gastbuch ORDER BY gastID DESC");
$sth->execute();
print <<HERE_HEADER;
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Gästebuch</title>
<link rel="stylesheet" href="styles/gast.css">
</head>
<body bgcolor="#006633">
<table width="100%" border="0">
<tr><td><h1><center><strong>Gästebuch</strong></center></h1></td></tr>
HERE_HEADER
while (my @row = $sth->fetchrow_array() )
{
my $name = $row[0];
my $email = $row[1];
my $homepage = $row[2];
my $comment = $row[3];
print <<HERE_HTML;
<table width="60%" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#006633" bordercolor="#000000">
<tr>
<td width="84" height="25" valign="top"><strong>Name:</strong></td>
<td width="541" valign="top" bgcolor="#FFCC00" >$name</td>
</tr>
<tr>
<td height="25" valign="top"><strong>E-Mail:</strong></td>
<td valign="top" bgcolor="#FFCC00" ><a href="mailto:$email">$email</a></td>
</tr>
<tr>
<td height="25" valign="top"><strong>Homepage:</strong></td>
<td valign="top" bgcolor="#FFCC00" ><a href ="http://$homepage">$homepage</a></td>
</tr>
<tr>
<td height="25" valign="top" class="kommentar"><strong>Kommentar:</strong></td>
<td rowspan="3" valign="top" bgcolor="#FFCC00" class="kommentar"><p>$comment
</td>
</tr>
</table>
HERE_HTML
}
print <<HERE_FOOTER;
</body>
</html>
HERE_FOOTER
warn($DBI::errstr) if $DBI::err;
$sth->finish();
$dbh->disconnect();