Hallo,
Ich habe folgendes problem: wenn ich auf die seite localhost/sitemanagment/forum.php gehe kommen da die topics und unter den topics ist die tabelle von den forum beiträgen. aber das sollte eigentlich da sein wenn mann auf den topic link klickt .
.
Danke im voraus
Ich habe folgendes problem: wenn ich auf die seite localhost/sitemanagment/forum.php gehe kommen da die topics und unter den topics ist die tabelle von den forum beiträgen. aber das sollte eigentlich da sein wenn mann auf den topic link klickt .
PHP-Code:
<?php
mysql_connect("localhost", "admin", "*****");
mysql_select_db("gb");
$table = ("forum");
if ($action == "")
{
echo "<center>Click <a href=forum.php?action=post><strong>here</strong></a> to post a topic.<p>
<table width=79% border=0 bordercolor=blue>
<tr bordercolor=#0000FF bgcolor=Blue border=1>
<td width=57%><font color=Black>Topics:</font></td>
<td width=20%><font color=Black>Topic Poster:</font></td>
<td width=23%> <font color=Black>Topic Date:</font></td>
</tr></table>";
$select = "SELECT * FROM $table ORDER BY topic_id DESC";
$res = mysql_query($select) or die(mysql_error());
while($row = mysql_fetch_object($res))
{
echo "
<center><table width=79% border=0 bordercolor=blue>
<tr bordercolor=#FF9900 bgcolor=#0066FF>
<td width=57%><a href=forum.php?action=$row->topic_id>$row->topic_title</a></td>
<td width=20%><a href=mailto:$row->topic_mail>$row->topic_name</a></td>
<td width=23%>$row->topic_date</td>
</tr></table></center>";
}
}
if ($action == "post")
{
echo "<form method=post action=forum.php?action=wrdb><table width=75% border=0>
<tr>
<td>Name:</td>
<td><input name=topic_name></td>
</tr>
<tr>
<td>E-M@il:</td>
<td><input name=topic_mail></td>
</tr>
<tr>
<td>Topic Title:</td>
<td><input name=topic_title></td>
</tr>
<tr>
<td>Topic Message:</td>
<td><textarea rows=20 cols=70 name=topic_msg></textarea><input type=submit name=submit value=Send></form>
</td>
</tr>
</table>";
}
elseif ($action == "wrdb")
{
if ($submit)
{
if($topic_name == "" || $topic_title == "" || $topic_mail == "" || $topic_msg == "")
{
echo "Please go back and write correct values";
$error = "ja";
}
elseif ($error != "ja")
{
$topic_name = htmlspecialchars($topic_name);
$topic_title = htmlspecialchars($topic_title);
$topic_mail = htmlspecialchars($topic_mail);
$topic_msg = htmlspecialchars($topic_msg);
$date = (date("d-m-Y"));
$time = (date("H:i:s"));
$topic_date = "$date, $time";
$IP = getenv( "REMOTE_ADDR" );
$insert = "INSERT INTO $table (topic_name, topic_mail, topic_title, topic_msg, topic_date, ip) VALUES ('$topic_name', '$topic_mail', '$topic_title', '$topic_msg','$topic_date','$IP')";
$query = mysql_query($insert)or die(mysql_error());
setcookie(forum, ja, time()+15);
header("Location: forum.php");
}
}
elseif ($_COOKIE[forum] == ja)
{
echo "Board Floodcontroll:\"You can write you next topic in 5 minutes.\"";
}
}
if ($action == "$row->topic_id")
{
echo "
<table width=75% border=1>
<tr>
<td width=17%>Author:</td>
<td width=83%>Message:</td>
</tr>
<tr>
<td height=79>$row->topic_name</td>
<td>$row->topic_msg</td>
</tr>
</table>
";
}
?>
Danke im voraus
Kommentar