Page 1 of 1

question

Posted: Sun Mar 21, 2004 6:27 am
by jollyjumper
Hi Everyone,

I'm currently working on a project, but I can't solve a problem I'm facing.

What I would like to create is this:
I've got records that are based on a county and a category.
I want to start with both a list of categories, as well as a list of counties as an entrypoint.

The problem isn't in creating the lists or something, but it's the structure I want to do it in. I would like to use virtual subfolders.

Like when you start with selecting a category, you get on the page:
/categoryname/county_overview.php

and when you've selected the county, then you'll get into:
/categoryname/countyname/showlist.php

Also this isn't a problem. The problem starts when I want to start from the county list as well, as you would get this:

/countyname/category_overview.php
/countyname/categoryname/showlist.php

I don't know how I would be able to see which entrypoint the user has chosen, was it a category or a county(e.g. is the first subfolder name the name of a category or is it one of a county).

If you've got an idea about a solution, please post it, you would really help me a lot.

Greetz Jolly.

Posted: Sun Mar 21, 2004 6:32 am
by markl999
Depends on your exact setup, but presuming you can get/know the entry point, lets say $entrypoint, and the countries are in an array, then you could use in_array to see if $entrypoint is there, if not you can presume it's a category ?

Posted: Sun Mar 21, 2004 6:48 am
by jollyjumper
Hi Mark,

Thank you for your reply.

The categories and counties will be in a database.

I've thought about the sollution you spoke about before I posted my question, but the major downside about this is that I would have to select either all counties or categories to check this, even if I don't need all the other categories or counties.

I don't think it's a bad sollution, maybe it's the only one, but I'm hoping for a better one.

Greetz Jolly.

Posted: Sun Mar 21, 2004 7:50 am
by markl999
Yeah, if they are in a db then an array isn't the best way to go. Doesn't the database distinguish between countries and categories, so a simple SELECT can't find out which type of entry point was used?

Posted: Sun Mar 21, 2004 9:25 am
by jollyjumper
Hi Mark,

I don't exactly get what you mean by distinguish?

Greetz Jolly.