Alrighty, I was wondering what exactly I am doing wrong with adding the code to mysite. I have added the php code below so that you may view. Can someone give me a small walkthrough on how I can get this to work? I called the php below breadcrumb.php and added to the site with:
<?php
require("breadcrumb.php");
?>
The code creates links on your site like this:
Home > News > Headlines
Please help!
<?php
/*
* Breadcrumbs, version 1.02
* This code is copyright (c) Peter Bowyer, and is released
* under the lesser general public license (LGPL). Please leave this
* notice intact!
* This code was originally written for the F2S unofficial
* support site <[url]http://www.users.f2s.com[/url]>
*
* If you modify the code, please let me know. I am always
* after improvements! Contact me at <peter@mapledesign.co.uk>
*
*/
// If your server doesn't support $HTTP_HOST variable, uncomment the lower
// variable, and enter your site name. Do not remove the trailing slash!
$site = "http://".$HTTP_HOST."/";
// $site = "http://www.yoursite.com/";
// If you are on a windows machine you may have to alter this line.
$str = $PHP_SELF;
ereg("^(.+)/.+\\..+$", $str, $part);
$str = $part[1];
$str = substr($str, 1);
// Define the names you want given to each of the directories
// e.g. directory test has the label Test which will be visible
$label = array("test"=>"Test",
"faq"=>"FAQ/Tutorials",
"phorum"=>"Forums",
"links"=>"Links",
"asp2php"=>"ASP2PHP",
"whatsnew"=>"What's New",
"us"=>"Useful Stuff");
if (ereg("/", $str)){
$arr = split("/", $str);
$num = count($arr);
for($i=0; $i < $num; ++$i){
echo(" > <a href=\"". $site . $arr[$i] ."/\">".$label[$arr[$i]]."</a>");
$site = $site . $arr[$i] ."/";
}
}elseif (ereg("[a-zA-Z_]{1,}$",$str)){
$arr = $str;
echo(" > <a href=\"http://".$HTTP_HOST."/".$arr."/\">".$label[$arr]."</a>");
}else{
echo("");
}
?>