Here is a really simple way:
<?php
$expl = explode("/home/",$HTTP_SERVER_VARS["REQUEST_URI"]);
$tmp = $expl[1];
$expl = explode("/",$tmp);
$article_id = $expl[count($expl)-1];
echo "<a href='/home/'>Home</a> > ";
for ($x=0; $x < count($expl)-1; $x++) {
echo "<a href='/home/";
for ($z=0; $z < $x; $z++)
echo $expl[$z] . "/";
echo $expl[$x] . "/'>" . $expl[$x] . "</a> > ";
}
echo "<a href='/";
for ($z=0; $z < $x; $z++)
echo $expl[$z] . "/home/";
echo $expl[$x] . "/'>" . $expl[$x] . "</a>";
echo "<br><br><br><a href='la/'>la</a>";
echo "<br><a href='bla/'>bla</a>";
echo "<br><a href='blah/'>blah</a>";
echo "<br><a href='a/'>a</a>";
echo "<br><br><a href='/home/Downloads/'>Downloads</a>";
?>
Make a file called Home (no extension at all) and a file called .htaccess with this in it:
<FilesMatch "^home$">
ForceType application/x-httpd-php
</FilesMatch>
Now if you goto yoursite.com/home/ you'll see what happens.
I put some links so that you can see how to make them properly.
You may want to put a limit on it as they could make it as long as they wanted 🙂
Thats an easy way to get crumbs. For including content there are 2 ways:
- Have all your pages in the root dir and just use include($expl[$x]);
- Have the last term refer to a unique value in a database and get all the data/values..... like that
Hope that helps.
- Matt