| 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: | <table>
<?php
  $dbh = mysql_connect('localhost', 'g', 'lala')
  or exit("DB Fehler");
  mysql_select_db (testdb)
        or exit("Geht nicht!");
  $now = time();
  $ip = getenv("REMOTE_ADDR");
  $ref = getenv("HTTP_REFERER");
  $query = "insert into gaeste values ($now, '$ip', '$ref', '$name', '$eintrag')";
 if ($eintrag!="")
 {
   echo "Danke für Deinen Eintrag";
   $res = odbc_exec($dbh, $query);
 }
  $query = "select * from gaeste";
  $res = odbc_exec($dbh, $query);
  while (odbc_fetch_row($res))
  {
   $thename=odbc_result($res,"name");
   $theeintrag=odbc_result($res,"kommentar");
   echo "<tr><td>$thename</td><td>$theeintrag</td></tr>";
  }
  odbc_close_all();
?>
</table> |