hallo
ich habe ein kleines billig-gästebuch programmiert allerdings erfolgt kein automatischer refresh, d.h. man sie erst nach dem aktualisieren ansehen (dabei werden die daten nochmals gesendet, was natürlich auch dumm ist)
hier hab ich mal den quelltext:
<?php
include("../db1.php");
dbconnect();
mysql_select_db("db5");
$daten = mysql_query("SELECT * FROM gaestebuch ORDER BY datum DESC");
$datum = date("Y-m-d");
$titel = $_POST['titel'] ;
$inhalt = $_POST['inhalt'] ;
$autor = $_POST['autor'] ;
if (isset($_POST['titel'])){
mysql_query("INSERT INTO gaestebuch VALUES('$titel','$inhalt','$datum','$autor')");
}
?>
<html>
<head>
<title>Gaestebuch</title>
<meta http-equiv="expires" content="0">
<meta name="author" content="hessluc">
<meta name="generator" content="Ulli Meybohms HTML EDITOR">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<font face="ARIAL" size="-2" >
<form action="gaestebuch.php" method="post" target="">
Autor <br>
<input type="Text" name="autor" value="" size="33" maxlength=""> <br><br>
Titel <br>
<input type="Text" name="titel" value="" size="33" maxlength=""> <br><br>
Text <br>
<textarea name="inhalt" cols="25" rows="8" scroll="no"></textarea> <br><br>
<input type="Submit" name="Senden" value="Senden">
</form>
</font>
<div align="center">
<?php
while ($zeile = mysql_fetch_array($daten)) {
echo "<table width="500">
<Tr bgcolor="#999999">
<Td width="30%" align="center">";
echo $zeile['autor'] ;
echo "</td><td width="50%" align="center">" ;
echo $zeile['titel'] ;
echo "</td><td width="20%" align="center">" ;
echo $zeile['datum'] ;
echo "</td> </tr> <tr bgcolor="#cccccc"> <td colspan="3" align="justify">";
echo $zeile['inhalt'];
echo "</td> </tr> </table> <br>";
}
?>
</div>
</body>
</html>
kann man das vielleicht in den form-tag einbauen?