Hi I'm very new to php and I'm going over the Murach PHP book. I'm having a problem with clicking on a link in the categories section because when it clicks on the link it ads ?category_id=3
but the problem is it adds it after add_product.php
like-> http://localhost/my_murach_php/add_product.php?category_id=3
I want it to add after http://localhost/my_murach_php/
so it looks like http://localhost/my_murach_php/?category_id=3
I am able to see the categories when i click on the links before I do anything with adding products.
I could see the category info on the index page and when I click on it from the index page
I get to go to http://localhost/my_murach_php/add_product_form.php
(good) to add a product I click on the button and it takes me to http://localhost/my_murach_php/add_product.php
(good) then when I click a category I get this page http://localhost/my_murach_php/add_product.php?category_id=1
(not good) I would like it to be this page http://localhost/my_murach_php/?category_id=3
Here's how I Included the link on the index page
<li>
<a href="?category_id=<?php echo $category['categoryID']; ?>">
<?php echo $category['categoryName']; ?>
</a>
</li>
I have include("index.php");
in the add_product.php file
I guess the problem is going back to the root directory when I am on the http://localhost/my_murach_php/add_product.php?category_id=1
page.
Thank you