This is a double question: The correct answer will go to ‘How you do it in PHP’ explaining if there is any advantage goes also counts if possible.
I’m just curious because I really don’t know and I see it a lot in webpages.
Edit: I don’t know the technical name, but for example here on Stackoverflow: ‘http://stackoverflow.com/posts/edit/522452‘ is what I mean as ‘folders’ (a term previously used in the title of the question).
If you’re referring to
/posts/edit/522452-style URLs as opposed to/posts.asp?action=edit&postid=522452-style URLs (or whatever it translates to on the back end), this is typically done through a URL rewriter, such asmod_rewrite. A rule for that URL might look like this:The two primary advantages to this kind of URL are that:
In PHP, you can then access these options via
$_GET['action']and$_GET['postid'], exactly as if the browser had asked for the rewritten form.