
Hallo Hallo
hätte ne frage zum thema guestbook ich zeig euch mal den fehler
www.hfckindberg.at
also wenn man auf der seite auf guestbook geht und dann auf eintragen kommt ein fehler weiß nur nicht warum vielleicht kann mir ja jemand helfen!!
hier das script:
new.php//hier wird der eintrag gemacht
<?php
include ("function.inc.php");
if (isset($_REQUEST["do"]) && $_REQUEST["do"] == "insert")
{
$error_msg = "";
if ($_REQUEST["form_name"] == "")
{
$error_msg = "Sie müssen bitte den Namen angeben";
}
if ($error_msg == "") {
$datum = date("d.m.Y");
mysqlconnect();
//Insert
$query = "INSERT INTO gbook (name,email,homepage,text,datum) VALUES (";
$query .= " '" . $_REQUEST["form_name"] ."', ";
$query .= " '" . $_REQUEST["form_email"] . "', ";
$query .= " '" . $_REQUEST["form_homepage"] . "', ";
$query .= " '" . $_REQUEST["form_text"] ."', ";
$query .= " '" . $datum ."' ";
$query .= ")";
$result = mysql_query($query);
if (!$result) {
die("Konnte Datensatz nicht eintragen" . mysql_error);
}
//auf Hauptseite wechseln
header("Location: main.php");
die();
}
}
?>
<html>
<head>
<title>Guestbook</title>
<link rel="stylesheet" type="text/css" href="page.css">
</head>
<body>
<table width="300px">
<tr>
<td> </td>
<td> </td>
<td align="right"><a href="http://www.hfckindberg.at/index.php?section=book" style="text-decoration:none;">zu den Einträgen</a></td>
</tr>
</table>
<div style="border : 1px solid #cccccc; top:100px; position: absulute; width :300px; height:320px">
<form action="<?php echo $_REQUEST["SELF_PHP"]; ?>" method="POST" name="form">
<table width = "100%">
<tr>
<td></td><td></td><td width = "300px" align = "right">Datum: <?php echo date("d.m.Y"); ?></td>
</tr>
<tr>
<td></td><td></td><td></td>
</tr>
<tr>
<td>Name: </td><td></td><td><INPUT type="text" style="width:200px" name="form_name" value="" /></td>
</tr>
<tr>
<td>E-mail: </td><td></td><td><INPUT type="text" style="width:200px" name="form_email" value="" /></td>
</tr>
<tr>
<td>Homepage: </td><td></td><td><INPUT type="text" style="width:200px" name="form_homepage" value="http://" /></td>
</tr>
<tr>
<td><INPUT type="hidden" name="do" value="insert"/></td><td></td><td><TEXTAREA name="form_text" rows=" 10 " cols="22"></TEXTAREA></td>
</tr>
<tr>
<td><Input type ="submit" value = "Eintragen"></td><td></td><td></td>
</tr>
</table>
</form>
</div>
</body>
<html>
main.php//hier sieht man die einträge
<?php
include ("function.inc.php");
if(isset($_REQUEST["seite"]) && $_REQUEST["seite"] != "")
{
$seite = $_REQUEST["seite"];
}
else
{
$seite = 1;
}
mysqlconnect();
//Bestimmen der Datensatz Anzahl
$gesamt = howmany();
$seitengesamt = ceil($gesamt/5);
$offset = ($seite -1)*5;
$query = "SELECT * FROM eintragen ORDER BY id DESC LIMIT " . $offset ." , 5";
$result = mysql_query( $query );
if (!$result) {
die("Konnte keine Verbindung herstellen");
}
$anzahl = mysql_num_rows($result);
?>
<html>
<HEAD>
<TITLE>GUESTBOOK</TITLE>
<link rel="stylesheet" type="text/css" href="page.css">
</HEAD>
<BODY>
<h1>Gästebuch</h1>
<p></p>
<p></p>
<TABLE width="600px">
<tr>
<td> </td>
<td align="center"></td>
<td align="right"><a href="index.php?section=new_entry" style="text-decoration:none; ">Eintragen</a></td>
</tr>
</table>
<TABLE width="600px">
<tr>
<td align="center">Seite <?php echo $seite; ?> von <?php echo $seitengesamt; ?></td>
</tr>
</TABLE>
</TABLE>
<?php
for ($i = 1;$i <= $anzahl; $i++)
{
$datensatz = mysql_fetch_array( $result );
?>
<DIV style="background-image:url(hintergrund_guestbook.png);background-repeat:no-repeat;background-position:500px 85px; z-index:1;border : 1px solid #cccccc; top:120px; position: absulute; width :600px; height:150px">
<TABLE width ="600" cellspacing="2" cellpadding="2" table-layout:"fixed">
<tr>
<td bgcolor="#cccccc"> </td>
</tr>
<tr>
<td><a href=""><?php echo $datensatz["name"]; ?></a> schrieb am <?php echo $datensatz["datum"]; ?></td>
<tr>
<td bgcolor="#cccccc" align="right"><a href="<?php echo $datensatz["homepage"]; ?>">Homepage</a></td>
</tr>
<tr>
<td style="border-top: 1px dashed #cccccc;font-weight:bold;"><?php echo $datensatz["text"]; ?></td>
</tr>
</TABLE>
</DIV>
<p></p>
<?php
}
?>
<TABLE width="600">
<tr>
<td width="200px" align="center">Seite <?php echo $seite; ?> von <?php echo $seitengesamt; ?></td>
</tr>
<tr>
<?php
if ($seite != 1)
{
?>
<td width="200px" align="left"><a href="<?php echo $_REQUEST["PHP_SELF"]; ?>?seite=<?php echo $seite - 1; ?>" align ="center" style="text-decoration=none;"><<<</a></a></td>
<?php
}
?>
<?php
if (($seite+1) <= $seitengesamt)
{
?>
<td width="200px" align="right"><a href="<?php echo $_REQUEST["PHP_SELF"]; ?>?seite=<?php echo $seite +1; ?>" align ="center" style="text-decoration=none;">>>></a></a></td>
<?php
}
?>
</tr>
</TABLE>
</BODY>
</html>