how can I use bread crumb in PHP ?
Answers were Sorted based on User's Feedback
Answer / latha
<?php
session_start();
include("./Breadcrumb.php");
$trail = new Breadcrumb();
$trail->add('Home', $_SERVER['PHP_SELF'], 0);
//Sample CSS
echo "
<style>
#breadcrumb ul li{
list-style-image: none;
display:inline;
padding: 0 3px 0 0;
margin: 3px 0 0 0;
}
#breadcrumb ul{
margin:0;padding:0;
list-style-type: none;
padding-left: 1em;
}
</style>
";
//Now output the navigation.
$trail->output();
?>
| Is This Answer Correct ? | 0 Yes | 0 No |
create a session array variable in the homepage or index page,
$_SESSION['page_name']= array();
index.php :-
$_SESSION['page_name'][]=array('title'=>'Home','page'=>'index.php');
contact_us.php :-
$_SESSION['page_name'][]=array('title'=>'Contact Us
','page'=>'contact_us.php');
similarly for all the pages.
where you want to display the bread crumb just paste this code.
foreach($_SESSION{'page_name'] as $brdcrum)
{
echo '<a
href="'.$brdcrum['page'].'">'.$brdcrum['title']."</a> >> ";
}
| Is This Answer Correct ? | 1 Yes | 3 No |
What is abstract class php?
How to make multilanguage site in php? (like english,tamil)
What is difference between variable declaration and variable definition?
What is the use of print_r function in php?
Differentiate between php5 and php7?
What library is used for pdf in php?
How do functions work?
Is php closing tag necessary?
What does php mean?
What is traits? How it is used in php?
Explain about PHP cookies?
How to link one site backend to another site frontend?