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 are the different ways to login to a remote server? Explain the me, advantages and disadvantages?
What is crypt () in php?
Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?
how to display and include the user system date/time in a php program/project
Is php faster than python?
Do you know what does $globals means?
Why do we use polymorphism in php?
Write the statements that are used to connect php with mysql
Can anybody plz tell me if there any recruitment on php plz mail to vasudev.adepu@gmail.com.i had completed M.SC(MATHS) in 2007 . trying to get a job on php. i have good knowledge on PHP/MYSQL
Is array a key php?
How to close a session properly?
i start a new session with : session_start(); then i set some session variable like this : $_SESSION['name']=$_POST['name'];\ and some another variables. at bottom of page i set header to diffrent page : header('location: index.php'); exit(); now in new page (index.php i can't access to my session variables, like $_SESSION['name']) what's wrong ? thanks. here is my files : a.php ======================================== session_start(); require ('config.inc.php'); if(isset($_POST)) foreach($_POST as $v=>$k) { $items[$v]=$k; } $sql="SELECT * FROM members WHERE username='{$items['user']}' AND pass=MD5('{$items['Password']}') "; $res=mysql_query($sql); $row=mysql_fetch_assoc($res); if($row['username']) { $_SESSION['type']=$row['type']; $_SESSION['name']=$row['name']; $_SESSION['family']=$row['family']; $_SESSION['username']=$row['username']; $_SESSION['date']=$row['date']; } header('location: admin.php'); exit(); ====================================== admin.php ===================================== <?php session_start(); if(!isset($_SESSION['admin'])) { header('location: index.php'); exit(); } require ('config.inc.php'); ?> . . . =================================