Solved

breadcrumb script needed

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHPStorm debugging issues 1 44
Intermittent Error on Page Loading 4 55
Php recording post 4 37
PHP Query return divisible by 3 3 15
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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

786 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