How do I pass a URL variable to a results page?
I am attempting to create frequently asked questions php pages where an individual will start at a page (library.php) listing various categories; and from there, the individual can select a category and be redirected to another page (library_results.php) to view only those questions and answers under that category .
Based on prior experience, I understand that a variable will need to be created which can be passed from the library.php page to the library_results.php page (the variable I considering using is FaqCatID). I have already setup the appropriate MYSQL database and tables, including a table where I have listed the categories (faqcategory) and another table where the questions and answers are located (faquestions). In the faquestions table, I have included a category ID column (FaqCatID) where I am attempting to organize the questions and answers by the appropriate category.
Since I am working with two tables, I am lead to believe that a relationship may need to be created so the two tables see each other and can distinguish those questions and answers from the categories.
Here is what I have done so far:
1. I have created a URL Variable (FaqCatID) on the library.php page.
2. On the library.php page, I have inserted a recordset using the faqcategory table and filtered it by the tables FaqCatID - Session Variable FaqCatID.
3. On the library.php page, each category is setup up as a hyperlink to library_results.php page (i.e., <a href="library_faq.php?FaqCatID=1"> Meal Periods </a>)
4. On the library_results.php page, I have inserted a recordset using the faquestions table. I recordset is not filtered (I do not know what to do here).
5. On the library_results.php page, I have bound parts of the recordset to the page to show the questions and answers. There is also a repeat region to show up to 10 results.
Of course, I am not getting the desired results. So, I know that I am goofing up somewhere.
Where I need assistance is how to pass the appropriate variable from the library.php page to the library_results.php page so only those questions and answers show under the category the individual previously selected from the library.php page. I am also uncertain how to go about creating the appropriate recordsets for each page.
I have attached the pages to this post for your information.