tagwall problemer
Jeg kan ikke tilføje beskeder når jeg gør det på denne måde.http://www.randersen.dk/privat/test/index.php?side=tagwall
Men kan godt tilføje via denne sti.
http://www.randersen.dk/privat/test/tagwall.php
tagwall.php
.
<?php
include("connect.php");
include("ban.php");
$antal_pr_side = 10;
$offset = (isset($_GET['offset']) && is_numeric($_GET['offset'])) ? $_GET['offset'] : 0;
$antal = mysql_result(mysql_query("SELECT COUNT(*) FROM index_tagwall"),0);
if ($offset >= $antal_pr_side)
{
$forrige = $offset-$antal_pr_side;
echo "<a href='?side=tagwall&offset=$forrige'>Forrige</a> | ";
}
if ($antal > $offset+$antal_pr_side)
{
$naeste = $offset+$antal_pr_side;
echo "<a href='?side=tagwall&offset=$naeste'>Næste</a>";
}
$query = mysql_query("SELECT * FROM index_tagwall ORDER BY id DESC LIMIT $offset, $antal_pr_side")or die(mysql_error());
echo "<table border=1 cellpadding=0 cellspacing=0 style=border-style:dotted; border-width:1; border-collapse: collapse bordercolor=#111111 width=100%>";
if(mysql_num_rows($query)>0)
{
while($row = mysql_fetch_assoc($query))
{
echo "<tr><td width=50% bgcolor=#76B03C bordercolor=#76B03C><b>" . $row["navn"] . "</td><td width=50% bgcolor=#76B03C bordercolor=#76B03C><p align=right>" . $row["tid"] . "</b></td></tr><tr><td width=100% bgcolor=#7EBD40 bordercolor=#7EBD40 colspan=2>" . $row["besked"] . "</td></tr><tr><td></td></tr><tr><td></td></tr>";
}
}
else
{
echo "Ingen opslag...";
}
echo "<br/></table><br/>";
if ($offset >= $antal_pr_side)
{
$forrige = $offset-$antal_pr_side;
echo "<a href='?side=tagwall&offset=$forrige'>Forrige</a> | ";
}
if ($antal > $offset+$antal_pr_side)
{
$naeste = $offset+$antal_pr_side;
echo "<a href='?side=tagwall&offset=$naeste'>Næste</a>";
}
?>
<form action="action_tagwall.php" method="POST">
<input type="hidden" name="action" value="login">
<div align=center>Navn <br>
<input type="text" name="navn" size="15" style="border:1px dotted #000000; background-color: #99CC66"><br>
Email <br>
<input type="text" name="mail" size="15" style="border:1px dotted #000000; background-color: #99CC66"><br>
Besked <br>
<input type="Text" name="besked" size="15" style="border-style:dashed; border-width:1; background-color: #99CC66"><br><br>
<input type="submit" value="Tilføj Besked" style="border:1px dotted #000000; background-color: #99CC66">
</div>
action_tagwall.php
.
<?php
include("connect.php");
$navn = mysql_escape_string($_POST["navn"]);
$mail = mysql_escape_string($_POST["mail"]);
$besked = mysql_escape_string($_POST["besked"]);
$ip = mysql_escape_string($_POST["ip"]);
$tid = date("j. M. Y");
mysql_query("INSERT INTO index_tagwall (navn,mail,besked,ip,tid) VALUES ('".$navn."','".$mail."','".$besked."','".$_SERVER['REMOTE_ADDR']."','".$tid."')") or die("Invalid query: " . mysql_error());
header("location: " . $_SERVER["HTTP_REFERER"]);
?>
