Solved

breadcrumb script needed

Posted on 2007-11-17
3
205 Views
Last Modified: 2010-08-05
Hi,
I've got a lot of php files in the root folder of my site, I want to build a navigation that when a user clicks on different links the breadcrumb show the proper navigation where they are on the site. I dont want to display the file names, just text that i will put in. does anybody know a good script to do this?
0
Comment
Question by:markmchugh
  • 2
3 Comments
 
LVL 20

Expert Comment

by:steelseth12
ID: 20304398
You want to put in what links / name is going to display on every page ?
Can you explain how you would like it to work ?
0
 

Author Comment

by:markmchugh
ID: 20304504
for example, i have the hompage, index.php, for this i will display 'home' in the breadcrumb

then the user can select 4 different pages, page1.php, page2.php, page3.php, page4.php

for each of these i want to display the name correspnding to the content, which is "jobs" or "adverts" or "news" or "latest updates"

then each  of these will go to another page, which i will read from a database
0
 
LVL 20

Accepted Solution

by:
steelseth12 earned 500 total points
ID: 20304533
Not sure if this is what you are looking for ... let me know.
$nav = array("home"=>"index.php","news"=>"page1.php");
 

$navication = breadcrumps ($nav);
 

print $navication;
 

function breadcrumps ($nav) {
 

	$r = "";

	

	$i=0;

	

	foreach($nav as $name=>$link) {
 

		$r .= ($i?" -> ":"")."<a href='".$link."'>".$name."</a>";

		

		$i++;

	}

	

	return $r;
 

}

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now