Hello,
I have a page called city.php which displays a list of major cities based on the state selected. I have an index.html page which has all the state names with links like city.php?state=California, city.php?state=Texas, and so on.
Since the link is setup this way, I am able to query for the user selected state by using state = '{$_GET['state']}'
Using $_GET I am able to display cities based on the state clicked by user.
I have a page called category.php and I do the same thing.
I list categories based on city clicked, the problem here is all cities have the same categories (about 40 categories) so all I do on this page is select * from category;
On this page I give link for each category as: categorydetails.php?category=Automobile and so on.
Doing this, I am able to display details on the category selected by user.
But my selection is based on the category (using $_GET)
I also want to use city in my query.
What I mean is: I want to display categories for the category selected by the user in category.php page and ONLY FOR THE CITY SELECTED BY THE USER IN THE CITY.PHP page.
This is where I have trouble.
I don't have the city value stored anywhere to use it on categorydetails.php page.
I am able to use city on the category.php page using $_GET, but not on categorydetails.php page.
Is there a way that I could use the value of city from the category.php page in my categorydetails.php query page?
Now the link for each category is setup like this: categorydetails.php?category=$category
I also tried:
categorydetails.php?category=$category&city=$city
and used city in my query in categorydetails.php page, but I dont get any results nor errors.
Please help me.
Regards,