Tengo un codigo php en el cual muestra el tema creado pero me gustaria en el <title>que muestre el titulo del tema</title>
Tengo el archivo topic.php y header.php
En el header tengo asi
<title> <? echo $page_title; ?></title>
Y el topic.php
Código PHP:
<?php
//create_cat.php
$page_title = Como hago para que muestre el titulo del tema;
//Load header
include_once('./header.php');
?>
<div id="logoAndGIT">
<div id="logo">
<h1>
<a href="http://interaccionweb.com/">
</a>
</h1>
</div>
<div id="getInTouch">
<p id="GIT-title">Buscar en la web</p>
<div id="searchbox">
<form method="get" class="searchform" action="" >
<input type="text" value="buscar…" name="s" class="s" onFocus="if (this.value == 'buscar…') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'buscar…';}" />
<input type="submit" class="searchsubmit" value="Buscar" />
</form>
</div></div>
<div id="main" >
<?php
include 'global.php';
$sql = "SELECT
topic_id,
topic_subject
FROM
topics
WHERE
topics.topic_id = " . mysql_real_escape_string($_GET['id']);
$result = mysql_query($sql);
if(!$result)
{
echo 'The topic could not be displayed, please try again later.';
}
else
{
if(mysql_num_rows($result) == 0)
{
echo 'This topic doesn′t exist.';
}
else
{
while($row = mysql_fetch_assoc($result))
{
//display post data
echo '<table class="topic" border="1">
<tr>
<div id="title_forums"> <th colspan="2"> <span style="float:right;margin-right:5px;"></span> <strong>' . $row['topic_subject'] . '<strong></th></div>
</tr>';
//fetch the posts from the database
$posts_sql = "SELECT
posts.post_topic,
posts.post_content,
posts.post_date,
posts.post_by,
users.id,
users.username
FROM
posts
LEFT JOIN
users
ON
posts.post_by = users.id
WHERE
posts.post_topic = " . mysql_real_escape_string($_GET['id']);
$posts_result = mysql_query($posts_sql);
if(!$posts_result)
{
echo '<tr><td>The posts could not be displayed, please try again later.</tr></td></table>';
}
else
{
while($posts_row = mysql_fetch_assoc($posts_result))
{
echo '<tr class="topic-post">
<td class="user-post">' . $posts_row['username'] . '<br/>' . date('d-m-Y H:i', strtotime($posts_row['post_date'])) . '</td>
<td class="post-content">' . htmlentities(stripslashes($posts_row['post_content'])) . '</td>
</tr>';
}
}
if (isset($_SESSION['id']))
{
$userid = $_SESSION['id'];
$username = $_SESSION['username'];
//show reply box
echo '<tr><td colspan="2"><h2>Reply:</h2><br />
<form method="post" action="reply.php?id=' . $row['topic_id'] . '">
<textarea name="reply-content"></textarea><br /><br />
<input type="submit" value="Submit reply" />
</form></td></tr>';
}
else
{
echo '<tr><td colspan=2>You must be <a href="signin.php">signed in</a> to reply. You can also <a href="signup.php">sign up</a> for an account.';
}
//finish the table
echo '</table>';
}
}
}
?>
Quien pueda ayudarme se los agradezco!
Saludos!:risa: