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 age a variable in research?

0 Answers  


display selected value in dropdown list through javascript without page refresh

5 Answers   ASD Lab,


where do we use htaccess?

0 Answers  


What is the empty function?

0 Answers  


What is the difference between abstract class and interface in php?

0 Answers  


Why is php used for web development?

0 Answers  


What is mean by RSS?How can i use this?

1 Answers   TCS,


what are the errors and when we get that particular errors.and who will give that errors

3 Answers  


i got 2 year backs in my MCA,i am 28 year guy, presently learning PHP, can i get the job & on facing the interview wht i will answer out for that?? (experience in as a 1.5yr System analyst after graduation)

0 Answers  


What is register_globals in php?

6 Answers   Castling IT, HCL, Intel Soft Solutions, Millennium,


How long does a session last in php?

0 Answers  


Does mysql need php?

0 Answers  


Categories