I have been searching for a breadcrumbs script for weeks and keep getting pointed to this one
http://www.zend.com/zend/spotlight/breadcrumb28.php
Every time i try an call the function, it displays all of the code and I get this error
Fatal error: Call to undefined function breadcrumb_nav() in d:\Apache\Apache\htdocs\index.php on line 10
Here is the code (I don't know if I have got it right)
<?php
$bc_site = (isset($HTTP_HOST)) ? "http://$HTTP_HOST/" : "http://yoursitenamehere.com/";
$bc_label = array("faq"=>"Frequent Questions",
"links"=>"Links",
"contact"=>"Contact Info"
);
?>
function breadcrumb_nav($basename = "Home") {
global $PHP_SELF, $bc_site, $bc_label;
$site = $bc_site;
$return_str = "<A HREF=\"/\">$basename</A>";
$str = substr(dirname($PHP_SELF), 1);
$arr = split('/', $str);
$num = count($arr);
if ($num > 1){
foreach($arr as $val) {
$return_str .= ' > <a href="'.$site.$val.'/">'.$bc_label[$val].'</a>';
$site .= $val.'/';
}
} elseif($num == 1) {
$arr = $str;
$return_str .= ' > <a href="'.$bc_site.$arr.'/">'.$bc_label[$arr].'</a>';
}
return $return_str;
}
?>
and I include/call the function using
<?php
include 'breadcrumb.php';
breadcrumb_nav();
?>
If anyone can help it would be a huge weight off my mind as this is really doing my head in