...

View Full Version : breadcrumb help



youandI
06-03-2007, 06:06 PM
After trying alot of tutorials on breadcrumbs I have found this one the best so far:
http://gr0w.com/articles/code/php_breadcrumb_links_creator/

I have got it to work on my home page but when I use it on another page it doesnt work :(

On my homepage in dreamweaver I have put this php code on my footer because this is where I want my breadcrumbs:

<?php $pagetitle="Home"; include("http://www.newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php"); ?>

This is inside the included file breadcrumb.php:

<?php
$ul_id='crumbs';
$bc=explode("/",$_SERVER["PHP_SELF"]);
echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li>';
while(list($key,$val)=each($bc)){
$dir='';
if($key > 1){
$n=1;
while($n < $key){
$dir.='/'.$bc[$n];
$val=$bc[$n];
$n++;
}
if($key < count($bc)-1) echo '<li><a href="'.$dir.'">'.$val.'</a></li>';
}
}
echo '<li>'.$pagetitle.'</li>';
echo '</ul>';
?>

When I view the page source of my homepage in firefox this is the code I see:

<ul id="crumbs"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li><li></li></ul>

I am not sure why there are so many </li>?

I have put the code below on my contact page:

<?php $pagetitle="Contact"; include("http://www.newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php"); ?>

When I view the contact page it still says Home and not Home > Contact :(

I tried adding a second $pagetitle2:

<?php $pagetitle="Home"; $pagetitle2="Contact";include("http://www.newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php"); ?>

and in the breadcrumb file I have added this:

echo '<li>'.$pagetitle.'</li>';
echo '<li>'.$pagetitle2.'</li>';

Nothing seems to work. I thought this was supposed to be easy lol

Please can someone help!?

youandI
06-04-2007, 01:39 AM
anyone?

CFMaBiSmAd
06-04-2007, 01:52 AM
By including the file using a http wrapper - http://www.newmedia.lincoln.ac.uk/ the include() function is actually making a http request back to your web server for the file. The file is being parsed by php and only any output from that file is being included. This also means that any variables you set outside of the file don't exist in the parsed code, which is why your $pagetitle variable value does not show up.

You need to include your file locally through a file system reference, not a http request.

There is another current thread with the same problem, see posts #16 and #17 in this thread - http://www.codingforums.com/showthread.php?t=115429&page=2

youandI
06-04-2007, 03:17 AM
You need to include your file locally through a file system reference, not a http request.

There is another current thread with the same problem, see posts #16 and #17 in this thread - http://www.codingforums.com/showthread.php?t=115429&page=2

Ok I read the posts 16 and 17 and I have noted you saying I need to specify a file system path.

Where and how exactly can I apply this in the code above? I have entered in the URL of my home page on this line:
echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li>';

How and where do I specify a file system path?

rafiki
06-04-2007, 02:22 PM
file system path is one which looks like


include("dir/to/incs/inc.me.inc");
//not
include("http://www.google.com");
//or
include("www.google.com");

youandI
09-11-2007, 12:15 PM
ok so I changed:
<?php $pagetitle="Home"; include("http://www.newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php"); ?>
to:

<?php $pagetitle="Home"; include("newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php"); ?>

The browser is saying this:

Warning: main(newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php): failed to open stream: No such file or directory in /home/webmedia/public_html/jecgardner/index.php on line 252

Warning: main(): Failed opening 'newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/webmedia/public_html/jecgardner/index.php on line 252

In the breadcrumb.php file there is this line:

echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li>';

Should I add copy and paste this line for my other pages like this:


echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Contact</a></li>';??

Nightfire
09-11-2007, 12:59 PM
include '/home/webmedia/public_html/jecgardner/breadcrumb.php';

youandI
09-11-2007, 01:11 PM
Still not working.. The browser doesn't give me an error no more but when I view my index page there is now no link on the footer?

This is where the breadcrumb is:
http://www.newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php

I have added the following lines to the breadcrumb.php file:


echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/contact.php">Contact</a></li>';
echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/year2.php">Year 2</a></li>';
echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/year3.php">Year 3</a></li>';


When you view the contact page on the footer it lists all the links (year2 and year3) but when you view the home page it doesn't even display the Home link??

This is where I have put the include:

<div id="footer_bl"></div>

Nightfire
09-11-2007, 01:14 PM
You're still putting the file path wrong.

You're putting:

newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php

It's not that, it's:

/home/webmedia/public_html/jecgardner/breadcrumb.php

youandI
09-11-2007, 01:57 PM
I did what you told me to do the first time:
<?php $pagetitle="Home"; '/home/webmedia/public_html/jecgardner/breadcrumb.php'; ?>

But in the breadcrumb.php file I have:


echo '<ul id="'.$ul_id.'"><li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li>';

youandI
09-11-2007, 02:58 PM
Ok I have changed this code in breadcrumb.php to the following:


echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li>';
echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/contact.php">Contact</a></li>';
echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/year2.php">Year 2</a></li>';


When you view my homepage (http://www.newmedia.lincoln.ac.uk/jecgardner/) there is no Home link in the footer? But when you view the contact page (http://www.newmedia.lincoln.ac.uk/jecgardner/contact.php) it lists all of these in the footer:
# Home
# Contact
# Year 2
# Contact

On the contact page it should just be Home > Contact

Why is it showing links to all the other pages in the footer and why isnt there any link on my home page?

aedrin
09-11-2007, 05:44 PM
It's not that, it's:

/home/webmedia/public_html/jecgardner/breadcrumb.php

This may not be wrong, it is bad.

If your website root is /home/webmedia/public_html/jecgardner/, you just need to do:



include 'breadcrumb.php';


Never use absolute paths unless it is completely necessary (rarely).

youandI
09-12-2007, 11:28 AM
Ok I am using this on my homepage (http://www.newmedia.lincoln.ac.uk/jecgardner):
<?php $pagetitle="Home"; include 'breadcrumb.php'; ?> on my
and I am using this on my contact page:
<?php $pagetitle="Contact"; include '/home/webmedia/public_html/jecgardner/breadcrumb.php'; ?>
Both seem to be ok but each page now lists all the links in the footer that I have added into the breadcrumb.php (http://www.newmedia.lincoln.ac.uk/jecgardner/breadcrumb.php) file.

On my home page I just want it to display: Home
On the contact page footer I want it to look like this: Home > Contact

Why does the home page and contact page both show all the links on the footer??:

Home
Contact
Year 2


This is how the breadcrumb.phps looks like:


<?
$ul_id='crumbs';
$bc=explode("/",$_SERVER["PHP_SELF"]);
echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li>';
echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/contact.php">Contact</a></li>';
echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/year2.php">Year 2</a></li>';
while(list($key,$val)=each($bc)){
$dir='';
if($key > 1){
$n=1;
while($n < $key){
$dir.='/'.$bc[$n];
$val=$bc[$n];
$n++;
}
if($key < count($bc)-1) echo '<li><a href="'.$dir.'">'.$val.'</a></li>';
}
}
echo '<li>'.$pagetitle.'</li>';
echo '</ul>';
?>

Nightfire
09-12-2007, 12:08 PM
Because you're echo'ing them at the top


echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a></li>';
echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/contact.php">Contact</a></li>';
echo '<li><a href="http://www.newmedia.lincoln.ac.uk/jecgardner/year2.php">Year 2</a></li>';

youandI
09-12-2007, 04:14 PM
ok its nearly working.. I would like to ask a few more questions:

The footer on my homepage repeats Home twice (Home > Home) to make it say one Home I deleted $pagetitle="Home" from:

<?php $pagetitle="Home"; include '/home/webmedia/public_html/jecgardner/breadcrumb.php'; ?>

I dont know if this is cheating or acceptable to delete $pagetitle="Home" so it says Home once. I have left the pagetitle in place so you can see what I mean CLICK HERE (http://www.newmedia.lincoln.ac.uk/jecgardner/index.php) and scroll to the footer to see what I mean!

The contact page, year 2 and year 3 pages breadcrumb seem to be working fine :)

However I have another problem when I try to add the breadcrumb to my comments page. This is because my comments page (journal.php) is inside a folder and not on the root directory.

This is the code I added to the comments footer:


<?php $pagetitle="Comments"; include '/home/webmedia/public_html/jecgardner/entry/breadcrumb.php'; ?>


This is what displays on the comments page (http://www.newmedia.lincoln.ac.uk/jecgardner/entry/journal.php?id=3):
Home > jecgardner
Comments

Why is it showing jecgardner? I have tried linking the breadcrumb like I have on all the other pages and I have also added the same breadcrumb file into the entry folder which is shown above. Any ideas how to fix this please?

I have one more question! Which is about the arrow (>) I have added in the breadcrumb.php file:

echo ' > '.$pagetitle.' ';
I was wondering how to not have the arrow appear on the home page? It looks ok on all the other pages Home > Contact.. But Home > wouldnt make sense? Is there a way around this?

Thanks for all the help!

youandI
09-13-2007, 10:11 AM
bump.. would like to know what someone thinks of my last post?

youandI
09-14-2007, 09:50 AM
ok its nearly working.. I would like to ask a few more questions:

The footer on my homepage repeats Home twice (Home > Home) to make it say one Home I deleted $pagetitle="Home" from:

<?php $pagetitle="Home"; include '/home/webmedia/public_html/jecgardner/breadcrumb.php'; ?>

I dont know if this is cheating or acceptable to delete $pagetitle="Home" so it says Home once. I have left the pagetitle in place so you can see what I mean CLICK HERE (http://www.newmedia.lincoln.ac.uk/jecgardner/index.php) and scroll to the footer to see what I mean!

The contact page, year 2 and year 3 pages breadcrumb seem to be working fine :)

However I have another problem when I try to add the breadcrumb to my comments page. This is because my comments page (journal.php) is inside a folder and not on the root directory.

This is the code I added to the comments footer:


<?php $pagetitle="Comments"; include '/home/webmedia/public_html/jecgardner/entry/breadcrumb.php'; ?>


This is what displays on the comments page (http://www.newmedia.lincoln.ac.uk/jecgardner/entry/journal.php?id=3):
Home > jecgardner
Comments

Why is it showing jecgardner? I have tried linking the breadcrumb like I have on all the other pages and I have also added the same breadcrumb file into the entry folder which is shown above. Any ideas how to fix this please?

I have one more question! Which is about the arrow (>) I have added in the breadcrumb.php file:

echo ' > '.$pagetitle.' ';
I was wondering how to not have the arrow appear on the home page? It looks ok on all the other pages Home > Contact.. But Home > wouldnt make sense? Is there a way around this?

youandI
09-16-2007, 08:01 PM
bump bump

Inigoesdr
09-16-2007, 11:03 PM
Post your breadcrumb file, and your questions again so they're clear.

youandI
09-16-2007, 11:48 PM
ok this is the breadcrumb.phps:


<?
$ul_id='crumbs';
$bc=explode("/",$_SERVER["PHP_SELF"]);
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> ';
while(list($key,$val)=each($bc)){
$dir='';
if($key > 1){
$n=1;
while($n < $key){
$dir.='/'.$bc[$n];
$val=$bc[$n];
$n++;
}
if($key < count($bc)-1) echo '<li><a href="'.$dir.'">'.$val.'</a></li>';
}
}
echo '>'.$pagetitle.' ';
?>


Ok my biggest problem atm is sorting out the breadcrumb on my comments page because this page isn't on the root like all the other pages (home, contact and work) the comments page is in a folder called entry (entry/journal.php). Click this link to see a comments page:
http://www.newmedia.lincoln.ac.uk/jecgardner/entry/journal.php?id=4
Scroll to the bottom of the site and you can see the footer looks like this:
Home > jecgardner
Comments

For some reason its added jecgardner in the breadcrumb linking to the homepage. I just want it to look like this: Home > Comments

I have also uploaded the breadcrumb.php into the same directory as the comments page but it produced the same result.. Should i change something in the breadcrumb code?

Another question about my homepage:
http://www.newmedia.lincoln.ac.uk/jecgardner/index.php

On the footer of the site you can see the breadcrumb which looks like this when you view the source:


<div id="footer_bl"> <a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> >Home </div>

I was wondering why it repeats home twice? I can remove the second Home by deleting $pagetitle="Home" from:


<?php $pagetitle="Home"; include '/home/webmedia/public_html/jecgardner/breadcrumb.php'; ?>
But i think this kinda destroys the point of using a breadcrumb if i was to delete that line?

I have also added an arrow (>) on this line:

echo ' > '.$pagetitle.' ';

I was wondering how to not have the arrow appear on the home page? It looks ok on all the other pages like: Home > Contact.. But Home > wouldnt make sense? Is there a way around this?

Inigoesdr
09-17-2007, 03:17 AM
Ok my biggest problem atm is sorting out the breadcrumb on my comments page because this page isn't on the root like all the other pages (home, contact and work) the comments page is in a folder called entry (entry/journal.php).
<snip>
Scroll to the bottom of the site and you can see the footer looks like this:
Home > jecgardner
Comments
It's grabbing it from the URL.. you can add an elseif() to the breadcrumb to have it treat the comments page special. ie.
if(normal page)
{
}
elseif($pagetitle == 'Comments')
{
// link comments page
}
else
{
}


But i think this kinda destroys the point of using a breadcrumb if i was to delete that line?

If you're on the homepage you don't need the breadcrumb at all, but you can do another elseif() like previously mentioned.

youandI
09-17-2007, 01:34 PM
Below is how I think you want me to alter the breadcrumb.php but when i uploaded the file the comments breadcrumb still looks the same:

<?
$ul_id='crumbs';
$bc=explode("/",$_SERVER["PHP_SELF"]);
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> ';
while(list($key,$val)=each($bc)){
$dir='';
if($key > 1){
$n=1;
while($n < $key){
$dir.='/'.$bc[$n];
$val=$bc[$n];
$n++;
}
if($key < count($bc)-1) echo '<li><a href="'.$dir.'">'.$val.'</a></li>';
}
elseif($pagetitle == 'Comments')
{
// link comments page
}
else
{
}
echo ' > '.$pagetitle.' ';

?>

Inigoesdr
09-17-2007, 05:52 PM
Below is how I think you want me to alter the breadcrumb.php but when i uploaded the file the comments breadcrumb still looks the same
Try this:

<?php
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> ';

if($pagetitle != 'Home')
{
if($pagetitle == 'Comments')
{
echo '<li><a href="/pathtocomments">Comments</a></li>';
}
else
{
$ul_id='crumbs';
$bc=explode("/",$_SERVER["PHP_SELF"]);

while(list($key,$val)=each($bc))
{
$dir='';
if($key > 1)
{
$n=1;
while($n < $key)
{
$dir.='/'.$bc[$n];
$val=$bc[$n];
$n++;
}
echo ' > '.$pagetitle.' ';
}
}
}
}
?>

It is not tested.

youandI
09-18-2007, 10:47 AM
Nice it works perfectly thank you very much! :)

I am trying to learn how you have done this.. How did you stop the home from repeating twice?

Where you put echo '<li><a href="/pathtocomments">Comments</a></li>'; i put this url: echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/entry/">Comments</a>'; but each comments has a special url like this:
http://www.newmedia.lincoln.ac.uk/jecgardner/entry/journal.php?id=5
with journal.php?id= i am not sure how to link each comment to there own id number so i have just left out a path and put echo '> Comments';

I comparing the old breadcrumb file to your newly added breadcrumb code so I can understand what is going on. This is what I am learning:

The breadcrumb starts with:
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> ';
and if ($pagetitle != 'Home') is not equal to (!=) 'Home' and if($pagetitle == 'Comments') is equal to (==) 'Comments' then echo '> Comments';
I kind of understand the above but the following code from the original file still gets me a bit lost :( Can you or someone break it down for me please??


$ul_id='crumbs';
$bc=explode("/",$_SERVER["PHP_SELF"]);

while(list($key,$val)=each($bc))
{
$dir='';
if($key > 1)
{
$n=1;
while($n < $key)
{
$dir.='/'.$bc[$n];
$val=$bc[$n];
$n++;
}
echo ' > '.$pagetitle.' ';

Inigoesdr
09-18-2007, 05:55 PM
i am not sure how to link each comment to there own id number
Use $_SERVER['REQUEST_URI'] for the link.

Can you or someone break it down for me please??
This is not my code, so I'm just telling you what is happening.


$ul_id='crumbs'; // setting the id for a <ul>, presumably to be used later..
$bc=explode("/",$_SERVER["PHP_SELF"]); // splitting PHP_SELF by forward slash into an array

while(list($key,$val)=each($bc)) // looping through the array; this is the same as foreach($bc as $key => $val)
{
$dir=''; // initializing an empty string variable
if($key > 1) // skipping the first key of the array
{
$n=1; // setting the iterator to 1
while($n < $key) // a second loop that sets the previous directories for breadcrumbs past the first
{
$dir.='/'.$bc[$n]; // append $dir with the current value
$val=$bc[$n]; // this... seems to serve no purpose
$n++; // advance the iterator
}
echo ' > '.$pagetitle.' '; // output the breadcrumb
// you're missing two closing brackets here

youandI
09-19-2007, 10:52 AM
Hi Inigoesdr thanks for noting what every line does!

On this line:

$ul_id='crumbs'; // setting the id for a <ul>, presumably to be used later..

On the tutorial page (http://gr0w.com/articles/code/php_breadcrumb_links_creator/) it says this about the $ul_id='crumbs';:


... and prints out an unordered list of breadcrumb links with the default <ul id="crumbs"> so it can be styled easily... This will print out a simple unordered list (<ul>) of the parent directories by directory name. The only edits you may wish to make to this file is to change the $ul_id='crumbs'; line if you wish to change the id of the <ul>. If you wish to add a background image or border etc to the <li> simply select it as #crumbs li{} and style.

I dont think I need to use $ul_id='crumbs' because I have put it in this div:

<div id="footer_bl"> <a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> >Home </div>

Can I change $ul_id='crumbs'; to $div_id='footer_bl'; ??


Use $_SERVER['REQUEST_URI'] for the link.

I added the above line like this:

echo '<a href="$_SERVER['REQUEST_URI']">Comments</a>';
This doesn't look right because im dreamweaver the color of this doesnt look the same as
$_SERVER["PHP_SELF"] where PHP_SELF is blue and REQUEST_URL is black?

and the browser says:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/webmedia/public_html/jecgardner/breadcrumb.php on line 8

I have also tried experimenting by adding this (which i found from here (http://www.phpfreaks.com/phpref/34.php) and changed it a little):


$pagetitle = $_SERVER['REQUEST_URI'];

echo "<a href=\"$pagetitle\">http://www.newmedia.lincoln.ac.uk/jecgardner/entry" .$pagetitle. Comments"</a>";


Now the browser says:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/webmedia/public_html/jecgardner/breadcrumb.php

:confused:

Inigoesdr
09-19-2007, 05:16 PM
I dont think I need to use $ul_id='crumbs' because I have put it in this div:

<div id="footer_bl"> <a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> >Home </div>

Can I change $ul_id='crumbs'; to $div_id='footer_bl'; ??

Yes, you can.



I added the above line like this:

echo '<a href="$_SERVER['REQUEST_URI']">Comments</a>';
This doesn't look right because im dreamweaver the color of this doesnt look the same as
$_SERVER["PHP_SELF"] where PHP_SELF is blue and REQUEST_URL is black?

It should be
echo '<a href="' . $_SERVER['REQUEST_URI'] . '">Comments</a>';





$pagetitle = $_SERVER['REQUEST_URI'];

echo "<a href=\"$pagetitle\">http://www.newmedia.lincoln.ac.uk/jecgardner/entry" .$pagetitle. Comments"</a>";


This should be
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/entry' . $_SERVER['REQUEST_URI'] . '">Comments</a>';

youandI
09-20-2007, 02:14 PM
nice its nearly perfect :thumbsup: :o

I have two more questions :cool: :eek:

When I click on the comments link in the breadcrumb it goes to this url:
newmedia.lincoln.ac.uk/jecgardner/entry/jecgardner/entry/journal.php?id=3 (http://www.newmedia.lincoln.ac.uk/jecgardner/entry/jecgardner/entry/journal.php?id=3)
when it should be:
newmedia.lincoln.ac.uk/jecgardner/entry/journal.php?id=3 (http://www.newmedia.lincoln.ac.uk/jecgardner/entry/journal.php?id=3)

its repeating jecgardner/entry twice?

and one other bizare problem is:

If you view my site in IE 6 and 7 the footer behaves strangley? Soon as you click on home or the next page of blog entries the footer jumps up to the top of the browser and goes out of position? Dont suppose you might know why it is doing this? It works ok in FF, Netscape and Opera but not IE :(

Inigoesdr
09-20-2007, 07:26 PM
Post the code you use. It looks like you put the directories in the echo at the top twice. For the other problem you can view the source and make sure all the tags are closed and everything... other than that it's probably just an HTML issue.

youandI
09-21-2007, 10:50 AM
breadcrumb.phps:


<?php
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/">Home</a> ';

if($pagetitle != 'Home')
{
if($pagetitle == 'Comments')
{
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/entry' . $_SERVER['REQUEST_URI'] . '">Comments</a>';
}
else
{
$div_id='footer_bl'; // setting the id for a <ul>, presumably to be used later..
$bc=explode("/",$_SERVER["PHP_SELF"]); // splitting PHP_SELF by forward slash into an array

while(list($key,$val)=each($bc)) // looping through the array; this is the same as foreach($bc as $key => $val)
{
$dir=''; // initializing an empty string variable
if($key > 1) // skipping the first key of the array
{
$n=1; // setting the iterator to 1
while($n < $key) // a second loop that sets the previous directories for breadcrumbs past the first
{
$dir.='/'.$bc[$n]; // append $dir with the current value
$val=$bc[$n]; // this... seems to serve no purpose
$n++; // advance the iterator
}
echo ' > '.$pagetitle.' '; // output the breadcrumb
// you're missing two closing brackets here
}
}
}
}
?>


far as i know all the tags are closed because it works fine in all browsers accept IE.. My site passes the W3C XHTML validation test.

Inigoesdr
09-21-2007, 06:52 PM
echo '<a href="http://www.newmedia.lincoln.ac.uk/jecgardner/entry' . $_SERVER['REQUEST_URI'] . '">Comments</a>';
Change to:


echo '<a href="http://www.newmedia.lincoln.ac.uk' . $_SERVER['REQUEST_URI'] . '">Comments</a>';

youandI
09-23-2007, 03:25 PM
cool thanks it works perfect now :):thumbsup: :thumbsup: :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum