473,411 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

dynamic breadcrum in php

hi i have a table in database having Module name and module id.and another table having section name crrosponding to each module.now i want to display the bread crums on my page in php.how can i do this.
i am using Url in My application as follows.MyFolder/crm.php?mod=3&sectionID=22&task=queueCont

according to this url i have to create a dynamic class for breadcrums for my application.please help me..
Jun 9 '11 #1
5 2097
nathj
938 Expert 512MB
If that URL has all the information in it to retrieve the breadcrumb from the database then it should be a simple task to query the DB to get the page names/titles and then use a horizontal list to display them.

I would recommend developing a small php function that would do jsut that - take the parameters from the url, query the datbase and return the breadcrumb string for display. This function could then be used whereever you need to display the breadcrumb.

Have a play around with that basic flow and if you get stuck with anything in particular post back here including a code snippet.

Cheers
nathj
Jun 10 '11 #2
how to create this function please provide some demo of this.i am confussed
Jun 10 '11 #3
nathj
938 Expert 512MB
Hi,

I am happy to help you with your own code, I am not going to simlpy provide the code for you. Here is a rough plan of what should happen:

1. pass the variables from the URL query string to a function as parameters.

2. make a database connection

3. query the database using the parameters to get the page and section titles

4. build a string that is the breadcrumb

5. return the string

6. echo the value to the screen.

Now it's over to you, you have a go at developing that. If you get stuck with any specific code post back the code you have and we will do our best to help you out.

Cheers
nathj
Jun 11 '11 #4
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/bamko3/includes/config.php');
class BreadCRM
{

function getBreadCrum($model_id,$section_id)
{
$sql="select moduleName from bmk3_modules where moduleId=$model_id"
$breadCrum = <<<PATH

<a href="crm.php?mod_id=$model_id">$row['moduleName']</a>
PATH;
$breadCrum .= " &raquo; ";
$sql="select sectionName,parentSection from bmk3_sections where sectionId=$section_id"
$breadCrum .="<a href='crm.php?mod_id=$model_id&section_id=$section _id'>section name</a>";
$parent_id=section parent section from above result

$sql="select sectionName from bmk3_sections where id=$parent_id"
$breadCrum .= "<a href='crm.php?mod_id=$model_id&section_id=$section _id&task=fetch section name'>section name</a>";
return $breadCrum;
}
}
?>
Jun 20 '11 #5
nathj
938 Expert 512MB
Hi Sunil,

Good to see you have had a crack at this function. DO you have any specific questions about this? If so post back and I'll do my best to answer them for you.

Cheers
nathj
Jun 21 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Roel Wuyts | last post by:
CALL FOR CONTRIBUTIONS International Workshop on Revival of Dynamic Languages http://pico.vub.ac.be/~wdmeuter/RDL04/index.html (at OOPSLA2004, Vancouver, British Columbia, Canada, October...
6
by: Materialised | last post by:
Hi Everyone, I apologise if this is covered in the FAQ, I did look, but nothing actually stood out to me as being relative to my subject. I want to create a 2 dimensional array, a 'array of...
3
by: Stephen Gennard | last post by:
Hello, I having a problem dynamically invoking a static method that takes a reference to a SByte*. If I do it directly it works just fine. Anyone any ideas why? I have include a example...
0
by: Leo | last post by:
I would like to create a Breadcrum Trail in a page header similar to the one Micorsoft uses on MSDN: hyperlinktofirstpage > hyperlinktonextpage > etc Does anyone know where I would find an...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
1
by: Peterwkc | last post by:
Hello all expert, i have two program which make me desperate bu after i have noticed the forum, my future is become brightness back. By the way, my problem is like this i the first program was...
5
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.