how can I use bread crumb in PHP ?

Answers were Sorted based on User's Feedback



how can I use bread crumb in PHP ?..

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

how can I use bread crumb in PHP ?..

Answer / asim shariff

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>&nbsp;>>&nbsp;";
}

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More PHP Interview Questions

Is it worth learning php in 2019?

0 Answers  


How break and continue while loop in php?

0 Answers  


List out some tools through which we can draw E-R diagrams for mysql?

6 Answers  


Which variable declarations within a class is invalid in php?

0 Answers  


Why php is used in html?

0 Answers  






How to execute a function in php?

0 Answers  


When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?

0 Answers  


How can we upload a php + mysql Site

1 Answers  


can any please tel me about "Expression Engine"

1 Answers  


How to delete a file from the system?

0 Answers  


write a program to print [123] [456] [789] note : braces also need to be printed

1 Answers   Net Solution,


How to uploaded files to a table?

0 Answers  


Categories