View Full Version : stuck on one part of my forum

01-29-2006, 03:27 AM
Hi. I'm creating a forum and got stuck in one spot. Here's the scenario:

Forum_category.php lists all of the available categories. User clicks on a category and is taken to view_category.php.
view_category.php shows all questions submitted for the selected category.
View_category.php has a link called Add Question.

Forgive me if I have trouble explaining the rest.
Right now the Add Question link just goes to add_question.php. But when I go to this page, I need to pass $category. I can't figure out how to code this line:
<td colspan="6" align="right" bgcolor="#E6E6E6" class="style2">Add Question (add_question.php)</td>

to pass $category to add_question.php so that when the user fills in the form on add_question.php, the selected category is properly inserted into the database.

Creative Insanity
01-29-2006, 05:47 AM
You need to select the catagories with their ID number which will make them all unique from each other. Then to post a new topic you add that to the ID.
You are best to do this with 2 tables, one with all the catagories and one with the posts and then join the 2 ID numbers in your query and this would make it way more easier for you when you add replies, or new catagories.

01-29-2006, 11:36 PM
Well, I did it a little differently, and got it to work so far, but got stuck again. I've attached all of my files, and you can see the forum at www.josephneri.com/forum_category.php.

So far, forum_category.php works. User selects a category, and view_category.php displays, showing all of the posts for the selected category. Perfect. Then the user selects the Add Question link, and add_question.php opens. It appears to me that the $category was passed through to this page (view_category.php?category=Welcome). However, when I try to submit the form, the response is not getting inserted into the database.

If someone can take a look and see if there's something I'm missing, that would be great.

Thanks so much!

02-01-2006, 10:39 PM
can anyone help me here?

02-01-2006, 11:24 PM
never mind - i got it to work!!!!