<?php $title = "Forums"; include("header.php"); ?>
<?php
// the Topic List
if ($view == topics) {
print "<table><tr><td width=150><u><b>Topic</td><td width=100><u><b>Starter</td><td width=50><b><u>Replies</td></tr>";
$tsel = mysql_query("select * from topics2");
while ($topic = mysql_fetch_array($tsel)) {
$replies = mysql_num_rows(mysql_query("select * from replies2 where topic_id=$topic[id]"));
if ($sticky == yes)
{
print "<tr><td><a href=forums.php?topic=$topic[id]>$topic[topic]</a></td><td>$topic[starter]</td><td>$replies</td></tr>";
}
print "<tr><td><a href=forums.php?topic=$topic[id]>$topic[topic]</a></td><td>$topic[starter]</td><td>$replies</td></tr>";
}
print "</table>";
print "</center><form method=post action=forums2.php?action=addtopic>";
print "Add Topic:<br><input type=text name=title2 value=Title><br><textarea name=body cols=30 rows=3>Body</textarea><br><input type=submit value=\"Add Topic\"></form>";
}
// View Topic
if ($topic) {
$topicinfo = mysql_fetch_array(mysql_query("select * from topics2 where id=$topic"));
if (empty ($topicinfo[id])) {
print "No such topic.";
include("footer2.php");
exit;
}
if ($stat[rank] == 'admin')
{
echo "<a href="forums2.php?action=sticky">sticky the topic</a>";
}
if ($action == sticky)
{
mysql_query("Update topics2 set sticky=yes where topic_id=$topic[id]");
echo "<a href="forums2.php?view=topics">back</a>">
}
=view print "<center><br><table class=td width=98% cellpadding=0 cellspacing=0><tr><td style=\"border-bottom: solid black 1px;\" bgcolor=eeeeee><b>$topicinfo[topic]</b> by $topicinfo[starter] (<a href=forums2.php?view=topics>back</a>)</td></tr>";
print "<tr><td>$topicinfo[body]</td></tr></table><br>";
$rsel = mysql_query("select * from replies2 topic_id=$topicinfo[id] order by id asc");
while ($reply = mysql_fetch_array($rsel)) {
print "<center><table class=td width=98% cellpadding=0 cellspacing=0><tr><td bgcolor=eeeeee style=\"border-bottom: solid black 1px;\"><b>$reply[starter]</b> says... (<a href=forums2.php?view=topics>back</a>)</td></tr>";
print "<tr><td>$reply[body]</td></tr></table><br>";
}
print "</center><form method=post action=forums.php?reply=$topicinfo[id]>";
print "Add Reply:<br><textarea name=rep cols=30 rows=3>Body</textarea><br><input type=submit value=\"Add Reply\"></form>";
}
// Add Topic
if ($action == addtopic) {
if (empty ($title) || empty ($body)) {
print "You must fill all fields.";
include("footer2.php");
exit;
}
mysql_query("insert into topics2 (topic, body, starter) values('$title2', '$body', '$stat[user]')") or die("Could not add topic.");
print "Added topic. Click <a href=forums2.php?view=topics>here</a> to go back to the topic list.";
}
// Add Reply
if ($reply) {
$exists = mysql_num_rows(mysql_query("select * from topics2 where id=$reply"));
if ($exists <= 0) {
print "No such topic.";
include("footer2.php");
exit;
}
if (empty ($rep)) {
print "You must fill out all fields.";
include("footer2.php");
exit;
}
mysql_query("insert into replies2 (starter, topic_id, body) values('$stat[user]', $reply, '$rep')") or die("Could not add reply.");
print "Reply added. Click <a href=forums2.php?topic=$reply>here</a>.";
}
?>
<?php
include("footer.php");
?>
Parse error: parse error, expecting `','' or `';'' in /home/www/dancha42.madpage.com/forums2.php on line 35
hopefully i wont have many moreim starting to learn to find them better, but i dont understand this parse error
















