Ich habe mal eine Frage.
Undzwar habe ich vor eine Blätterfunktion in mein Gästebuch einzubauen.
Ich weiss das ich dafuer LIMIT in Mysql einsetzen muss.
Doch wie genau ich es dann mit den einzelnen Seiten mache, weiss ich noch nicht.
Wäre echt cool, wenn ihr helfen könntet.
Nun zum Inhalt der *.php Datei, welche die Mysql Datenbank ausgibt.
PHP-Quellcode
- ..... CSS Formular etc.....
- <?php
- require('config.php');
- $vb = mysql_connect($host,$user,$pw);
- mysql_select_db("k1k0",$vb);
- $result = mysql_query("SELECT * FROM gaestebuch_tempel ORDER BY datum DESC",$vb);
- $v = mysql_num_rows($result);
- for ($i=0; $i<mysql_num_rows($result); $i++) {
- $gaestebuch[$i]=mysql_fetch_object($result);
- }
- for ($i=0; $i<mysql_num_rows($result); $i++, $v--) {
- require('inc/smilies.php');
- $gaestebuch[$i]->eingabe = str_replace($search, $replace, $gaestebuch[$i]->eingabe);
- $border = "border-top:1px ridge black; border-left:1px ridge black; border-right:1px ridge black";
- echo "<table style=\"$border\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"<?php echo $bgtable; ?>\" align=\"center\">",
- "<tr bgcolor=\"$bgtable_tr1\" width=\"440\">",
- "<td width=\"146\" align=\"left\">",
- "<font class=\"gbtr1\"> #";
- echo $v;
- echo "</font>",
- "</td>",
- "<td width=\"146\" align=\"left\">",
- "<font class=\"gbtr1\">",
- substr($gaestebuch[$i]->datum,8,2),
- ".",
- substr($gaestebuch[$i]->datum,5,2),
- ".",
- substr($gaestebuch[$i]->datum,0,4),
- "</font>",
- "</td>",
- "<td width=\"148\" align=\"right\">",
- "<font class=\"gbtr1\"><b>",
- $gaestebuch[$i]->betreff,
- "</b></font>",
- "</td>",
- "</tr>",
- "</table>",
- "<table style=\"border:1px ridge black\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"$bgtable\" align=\"center\">",
- "<tr>",
- "<td width=\"119\" style=\"border-right:1px ridge black\">",
- "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr height=\"3\"></tr><tr><td width=\"8\"></td><td><font class=\"gb\"><b>",
- $gaestebuch[$i]->name,
- "</b></font></td></tr>",
- "<tr><td></td><td><font class=\"gb\">",
- substr($gaestebuch[$i]->datum,10),
- "</font></td></tr>",
- "<tr><td></td><td><font class=\"gb\">Browser: ",
- $gaestebuch[$i]->browser,
- "</font></td></tr>",
- "<tr><td></td><td>";
- if ($gaestebuch[$i]->email) {
- $email = $gaestebuch[$i]->email;
- echo "<a href=\"javascript:void(0)\" onmouseover=\"kastl_her('$email')\" onmouseout=\"kastl_weg()\">",
- "<img src=\"images/email.gif\" border=\"0\"></a>";
- echo " ";
- }
- if ($gaestebuch[$i]->homepage) {
- if ($gaestebuch[$i]->homepage == "http://") {
- echo "";
- } else {
- $homepage = $gaestebuch[$i]->homepage;
- echo "<a href=\"$homepage\" target=\"_blank\"><img src=\"images/homepage.gif\" border=\"0\"></a>";
- echo " ";
- }
- }
- if ($gaestebuch[$i]->icq) {
- $icq_nummer = $gaestebuch[$i]->icq;
- echo "<a href=\"http://wwp.icq.com/",
- $icq_nummer,
- "\" target=\"_blank\">",
- "<img src=\"http://web.icq.com/whitepages/online?icq=$icq_nummer&img=11\" border=\"0\">";
- echo " ";
- }
- echo "</tr>",
- "</table>",
- "</td>",
- "<td width=\"5\"></td>",
- "<td width=\"315\">",
- "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr height=\"3\"></tr><tr><td width=\"8\"></td></tr></table>",
- "<font class=\"gb\">",
- $gaestebuch[$i]->eingabe,
- "</font></td>",
- "</tr>",
- "</table>",
- "<br>";
- }
- mysql_close($vb);
- ?>
- </body>
- </html>
mfg mortician