section based path in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ginigangadharan
Forum Newbie
Posts: 4
Joined: Thu Dec 01, 2011 3:56 am

section based path in php

Post by ginigangadharan »

Dear Geeks,

Here is my problem.
i have a site with categories and subcategories(may be unlimited) items.
eg: mysite.com/section/subsection/verysubsection/music etc

also mysite.com/music/hindi/latest - this path should list the items of of category music- hindi-latest . all these paths are virtual actually. right ?
How can i achive this.? i saw this technic on some classified sites, but didn't get the idea.

I am storing all my data in mysql db(all categories and items).

please help.

thank n regards
Gini
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: section based path in php

Post by social_experiment »

Seems to me you are refering to url rewriting (or 'clean URLs'); You can search the forum as the topic has been covered a few times or search on search engines for 'Clean URL's', mod_rewrite, URL rewriting
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: section based path in php

Post by Celauran »

Sounds like you're looking for a front controller. This should help get you started.
ginigangadharan
Forum Newbie
Posts: 4
Joined: Thu Dec 01, 2011 3:56 am

Re: section based path in php

Post by ginigangadharan »

hi social_experiment and Celauran,

thanks for the quick and effective replies..
now i am trying to apply it on my page.

I got all this from following article. thanks.
http://www.devarticles.com/c/a/Apache/U ... Page-URLs/

thanks again.

-gini
Post Reply