PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 18th, 2002, 09:19 PM
maccam maccam is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 4 maccam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Bread Crumb Navigation

Hi Guys,
Can anyone see where the problem is?
I can't get my bread crumb navigation to function properly.
At the moment it produces the correct "Home" link and the current position within the bread crumb but not the information (links) inbetween.
Any ideas?

Here is my index.php page:
PHP Code:
<?
include ("admin/include/dbconnect.php");
$query "SELECT CatID, CatParent, CatName FROM $table WHERE CatParent='1'";
$result mysql_query($query);
while(
$row mysql_fetch_array($result)){

          echo 
"<TR><TD WIDTH=\"100%\"><IMG BORDER=\"0\" SRC=\"images/arrow_W.gif\" width=\"6\" height=\"9\">"
          echo 
"<A HREF=\"results.php?id={$row['CatID']}\">{$row['CatName']}</A></TD></TR>";
}
?>


Here is a section of my results.php page:
PHP Code:
<?
if(!$id$id 1;
include (
"admin/include/dbconnect.php");

<?
function 
getParentID($childID){
    
$row mysql_fetch_row(mysql_query("SELECT CatParent FROM $table WHERE CatID = $childID ORDER BY CatID"));
    return 
$row[0];
    
}
if(
$id 1){
    
$nextID $id;
    do{
        
$nextID $ar[$count++] = getParentID($nextID);
    } while(
$nextID 1);
    
$ar array_reverse($ar);
    foreach(
$ar as $parent){
        if(
$parent 1){
            
$row mysql_fetch_row(mysql_query("SELECT CatName FROM $table WHERE CatID = $parent"));
            echo 
"&nbsp;<IMG border=0 height=9 src=\"images/arrow_W.gif\" width=6>&nbsp;<a href=\"results1.php?id=$parent\">$row[0]</a>";
            }
        else {

        echo 
"<table width=\"710\" border=\"0\" bgcolor=\"#ffffff\"><tr><td bgcolor=\"#ffffff\" width=\"598\"><a href=\"results.php?id=$id\">Home</a>";
        
        }
    }
    
$row mysql_fetch_row(mysql_query("SELECT CatName FROM $table WHERE CatID = $id"));
    echo 
"&nbsp;<IMG border=0 height=9 src=\"images/arrow_W.gif\" width=6>&nbsp;<b>$row[0]</b></td></tr></table>";
}
?>
HTML stuff here.........
<?
$query 
"SELECT CatID, CatParent, CatName FROM $table WHERE CatParent='$id'";
$result mysql_query($query);
while(
$row mysql_fetch_array($result)){

          echo 
"<TR><TD WIDTH=\"100%\"><IMG BORDER=\"0\" SRC=\"images/arrow_W.gif\" width=\"6\" height=\"9\">"
          echo 
"<A HREF=\"results1.php?id={$row['CatID']}&new_id=$id\">{$row['CatName']}</A></TD></TR>";

          }
?>


and finally the results1.php page:
PHP Code:
<?
if(!$id$id 1;
include (
"admin/include/dbconnect.php");

function 
getParentID($childID){
    
$row mysql_fetch_row(mysql_query("SELECT CatParent FROM $table WHERE CatID = $childID ORDER BY CatID"));
    return 
$row[0];
    
}
if(
$id 1){
    
$nextID $id;
    do{
        
$nextID $ar[$count++] = getParentID($nextID);
    } while(
$nextID 1);
    
$ar array_reverse($ar);
    foreach(
$ar as $parent){
        if(
$parent 1){
            
$row mysql_fetch_row(mysql_query("SELECT CatName FROM $table WHERE CatID = $parent"));
            echo 
"&nbsp;<IMG border=0 height=9 src=\"images/arrow_W.gif\" width=6>&nbsp;<a href=\"results1.php?id=$parent\">$row[0]</a>";
            }
        else {

        echo 
"<table width=\"710\" border=\"0\" bgcolor=\"#ffffff\"><tr><td bgcolor=\"#ffffff\" width=\"598\"><a href=\"results.php?id=$new_id\">Home</a>";
        
        }
    }
    
$row mysql_fetch_row(mysql_query("SELECT CatName FROM $table WHERE CatID = $id"));
    echo 
"&nbsp;<IMG border=0 height=9 src=\"images/arrow_W.gif\" width=6>&nbsp;<b>$row[0]</b></td></tr></table>";
    }
?>

<?
$query 
"SELECT CatID, CatParent, CatName FROM $table WHERE CatParent='$new_id'";
$result mysql_query($query);
while(
$row mysql_fetch_array($result)){

          echo 
"<TR><TD WIDTH=\"100%\"><IMG BORDER=\"0\" SRC=\"images/arrow_W.gif\" width=\"6\" height=\"9\">"
          echo 
"<A HREF=\"results1.php?id={$row['CatID']}&new_id=$new_id\">{$row['CatName']}</A></TD></TR>";
}
?>

Other HTML and php stuff below.........

Reply With Quote
  #2  
Old April 26th, 2004, 04:28 PM
apollo158 apollo158 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 0 apollo158 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Has anyone answered this one somplace else

This is the same problem that I am having, has anyone seen an answer to this elsewhere or can you explain what I am doing wrong?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Bread Crumb Navigation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 10 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek