Solved

breadcrumb script needed

Posted on 2007-11-17
3
195 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

11 Experts available now in Live!

Get 1:1 Help Now