how can I use bread crumb in PHP ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Is php an array?

681


Write logic to print Floyd's triangle in PHP?

746


Write a program to display reverse of any number?

667


Explain what is smarty?

777


Write a program in php to find the occurrence of a word in a string?

845


What is isset php?

702


What is the difference between == and === operator in PHP?

644


What is mysql_real_escape_string used for?

734


What is the difference between for and foreach in php?

673


What is the default session out time?

760


What is the default session time in php?

706


Does php need to be installed?

697


Tell me what are the functions to be used to get the image's properties (size, width and height)?

773


Does php need apache?

672


What is polymorphism?

2251