I am trying to print the topics from a phpbb forum, filtered first by category then by forum.
I am using this form to select the category
[code]
<form id=”category” method=”post” action=”forumtext.php”>
<select name=”category” size=”1″ style=”width: 30em”>
<?php$sql=”select cat_title FROM phpbb_categories”;
$rs=mysql_query($sql,$conn);
while($row=mysql_fetch_array($rs)){
echo(“<option>” . $row[‘cat_title’] .”</option>”);
}
?>
</select></p><p>
<input type=”submit” value=”Request Report”></p>
</form>
Then I am passing that choice to another form to select the forum from within the category
[code]
<form id=”forum” method=”post” action=”forumtextout.php”>
<select name=”forum” size=”1″ style=”width: 20em”>
$sql=”select forum_name FROM phpbb_forums left join phpbb_categories on phpbb_forums.cat_id=phpbb_categories.cat_id WHERE cat_title=’$_POST[category]’ ORDER BY forum_name”;
$rs=mysql_query($sql,$conn);
while($row=mysql_fetch_array($rs)) {
echo (“<option>” . $row[‘forum_name’] .”</option>”);
}
?>
</select><p>
<input type=”submit” value=”Request Post Report”></p></form>
That is where I am lost.
The page “forumtextout.php”
[code]
<h1><?php $_POST[‘category’] ?></h1>
<?php
$msg = $_POST[‘forum’];
echo “<p>The forum you selected is ” . $msg . “</p>”;
?>
returns an error “Undefined index: category”.
Can I maintain the value of $_POST[category] onto the second page?
Thanks,
Andy