Click to See Complete Forum and Search --> : Creating web directory links


vit
03-14-2009, 01:40 PM
I am doing Perl/CGI web application similar to "web directories".
Can somebody tell me what is the right organization of web directory links.
Let's say I have categories as files and each file record is a listing.
What is the best way to create links to directories on the first level and links to listings on the second level.

Sixtease
03-15-2009, 11:03 AM
Could you provide an example of a similar service? I'm not sure I understand what exactly you mean by web directories.

ryanlund
03-16-2009, 12:16 AM
Ok, i have come across this problem before. Basically the database table that you use for the category names(im assuming your using a database of some kind) would be set up something along the lines of

category_name | parent_category | category_id

From there you can work out what level the categories are on and the id of the parent categories. Or you could use a sql query to view all sub-categories such as:

SELECT `category_name` FROM `categories` WHERE `parent_category` = '12';

Hope this helps