problemer med gæstebog
Hej eksperter.Hvorfor se min gæstebog sådan her ud? www.team-nopanic.dk/communications ?
----------------------------------------
<?php
include "connect.php";
if(!$navn or !$besked)
{
}
else
{
$dato = date("d.m.Y - H:i:s");
$insertSQL = ("insert into tagwall (navn, email, hjemmeside, overskrift, dato, besked)
values ('$navn', '$email', '$hjemmeside', '$overskrift', '$dato', '$besked')");
mysql_query($insertSQL) or die(mysql_error());
mysql_close();
}
?>
<style>
b {
color: #666666;
font-size: 10;
font-family: verdana;
}
p {
color: #CCCCCC;
font-size: 10;
font-family: verdana;
}
b.lille {
color: #666666;
font-size: 10;
font-family: verdana;
}
.form {
background-color: #ffffff;
border: 1 solid #CCCCCC;
width: 180;
height: 18px;
font-family: verdana;
font-size: 10px;
color: #CCCCCC;
}
</style>
<div align="center">
<table width="700" height="" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" colspan="2">
<?php
include "connect.php";
$resultat = mysql_query("select * from tagwall");
$nummer = mysql_num_rows($resultat);
echo "<p><b>Gæstebog</b> - Der er $nummer beskeder i gæstebogen</p>";
?>
</td>
</tr>
<?php
include "connect.php";
$limit = "10";
$mysql_query = "select * from tagwall";
$fremad = "Næste 10";
$tilbage = "Forrige 10";
if (!$count) {
$count = "0";
} else {
$count = $count;
}
$result = mysql_query("$mysql_query order by id desc limit $count,$limit");
$resultat = mysql_query("$mysql_query");
$number = mysql_num_rows($resultat);
while ($row = mysql_fetch_array($result)) {
$tag = nl2br($tag);
print "
<tr>
<td valign='top'>
<b class='lille'>$row[dato]: $row[overskrift] skrevet af: <a href='mailto:$row[email]'>$navn</a> - <a href='http://$row[hjemmeside]' target='_blank'>Hjemmeside</a></b>
</td>
</tr>
<tr>
<td valign='top'>
<p>$row[besked]</p>
</td>
</tr>
<tr>
<td valign='top'>
<hr width='100%' size='1' color='#000000'>
</td>
</tr>
";
}
$back = $count - $limit;
echo "<tr><td valign='top'><p>";
if ($count < "1") {
print " $tilbage ";
} else {
print " <a href='gb.php?count=$back'>$tilbage</a> ";
}
$forward = $count + $limit;
$Q = $forward - 1;
if ($number > $Q) {
if ($number == $forward) {
print " $fremad<";
} else {
print " <a href='gb.php?count=$forward'>$fremad</a>";
}
} else {
print "$fremad";
}
echo "</p></td></tr>";
?>
</table>
<form method="post" action="<? echo $_SERVER[PHP_SELF]; ?>">
<table width="673" height="" cellpadding="2" cellspacing="0">
<tr>
<td width="667" valign="top"> <b class="lille">Navn:</b> </td>
</tr>
<tr>
<td valign="top">
<input type="text" name="navn" class="form">
</td>
</tr>
<tr>
<td valign="top"> <b class="lille">Email:</b> </td>
</tr>
<tr>
<td valign="top">
<input type="text" name="email" class="form">
</td>
</tr>
<tr>
<td valign="top"> <b class="lille">Hjemmeside: (<u>UDEN</u> http://)</b> </td>
</tr>
<tr>
<td valign="top">
<input type="text" name="hjemmeside" class="form">
</td>
</tr>
<tr>
<td valign="top"> <b class="lille">Overskrift:</b> </td>
</tr>
<tr>
<td valign="top">
<input type="text" name="overskrift" class="form">
</td>
</tr>
<tr>
<td valign="top"> <b class="lille">Besked:</b> </td>
</tr>
<tr>
<td valign="top">
<textarea name="besked" class="form" style="width:250; height:100;"></textarea>
</td>
</tr>
<tr>
<td valign="top">
<input name="submit" type="submit" class="form" value="Tilføj">
</td>
</tr>
<tr>
<td valign="top">
<?php
echo "<p>$_GET[fejl]</p>";
?>