ComStarters
hi hi
Bookmark This Page

PHP BreadCrumbs

The simpliest php breadcrumbs script ever made.

This php script was submitted by rob
This script has been downloaded 52 times.
<?
        $pathd 
$_SERVER['PHP_SELF'];
    
$pathd preg_split('%\/%'$pathd, -1PREG_SPLIT_NO_EMPTY);
    
$traild $root '/';
    if (
count($pathd) <= 1) {
        
// we're in the site root, no links are needed
    
}
    else {
        
// create home link
        
echo "<a href='$traild' title='Home Page'>Home</a>\n";

        for(
$i=0$i<(count($pathd)-1); $i++) {
            
// more links needed to be created
            
$traild .= $pathd[$i] .'/';
            
$titled ucwords(str_replace('_'' '$pathd[$i]));
            echo 
"&#8594; <a href='$traild' title='$titled'>$titled</a>\n";
        }
        
// output current page title
        
$complete_urlname str_replace('.html'''$complete_url);
        
$complete_urlname explode('/'$complete_urlname);
            
$complete_count count($complete_urlname) -1;
            
$complete_urlname $complete_urlname[$complete_count];
            
$complete_urlnamestr_replace('-',' '$complete_urlname);
            
$complete_urlname=ucwords($complete_urlname);
        echo 
"&#8594; $complete_urlname \n";
    }
?>


Just place the script on the page you want the breadcrumbs displayed.
You can view the working sample at the top of any of our pages.


Submit your comment, question, critique etc..
feel free to enter your url too, it's a free link back to you:
Please keep your comment related to the content on this page.

Comments