T_VARIABLE
Hi, I dont know why, but I keep getting a parse error whenever I load this script.
The error is unexpected T_VARIABLE on line 31.
I have marked the line that has the problem.
<?php
// connected to database (this bit of code has been taken out for security reasons.)
$verify_topic = "select topic_title from forum_topics where topic_id = $_GET[topic_id]";
$verify_topic_res = mysql_query($verify_topic, $conn) or die(mysql_error());
if (mysql_num_rows($verify_topic_res) < 1) {
$display_block = "<P><em>You have selected an invalid topic. Please try again.<em></p>";
} else {
$topic_title = stripslashes(mysql_result($verify_topic_res,0,'top ic_title'));
$get_posts = "select post_id, post_text, date_format(post_create_time, '%b %e %Y at %r') as fmt_post_create_time, post_owner from forum_posts where topic_id = $_GET[topic_id] order by post_create_time asc";
$get_posts_res = mysql_query($get_posts,$conn) or die(mysql_error());
$display_block = "<P>Showing posts for the $topic_title topic:</p>
<table width=100% cellpadding=3 cellspacing=1 border=1>
<tr>
<th>AUTHOR</th>
<th>POST</th>
</tr>";
while ($posts_info = mysql_fetch_array($get_posts_res)) {
$post_id = $posts_info['post_id'];
$post_text = nl2br(stripslashes($posts_info['post_text']));
$post_create_time = $posts_info['fmt_post_create_time'];
$post_owner = stripslashes($posts_info['post_owner']);z
// THE NEXT LINE HAS THE T_VARIABLE ERROR:
$display_block .= "
<tr>
<td width=35% valign=top>$post_owner<br>[$post_create_time]</td>
<td width=65% valign=top>$post_text<br><br>
<a href=\"replytopost.php?post_id=$post_id\"><strong> REPLY TO POST</strong></a></td>
</tr>";
{
$display_block .= "</table>";
}
?>
<html>
<head>
<title>Forum</title>
</head>
<body>
<h1>Posts in Topic</h1>
<?php echo $display_block; ?>
</body>
</html>
|