PHP Build a Basic PHP Website Listing and Sorting Inventory Items Breadcrumbs

Martina Carrington
Martina Carrington
15,724 Points

i think it an error on my breadcrumbs.php coding

i follow steps on the video make the breadcrumbs coding but i don't see anything <?php include("inc/data.php"); include("inc/functions.php");

$pageTitle = "Full Catalog"; $section = null;

if(isset($_GET["id"])) { $id = $_GET["id"]; if (isset($catalog[$id])){ $item = catalog[$id];

}

} if(!isset($item)){ header("localtion:catalog.php"); exit; }

pageTitle = $item["title"]; $section = null;

include("inc/header.php"); ?>

<div class="section page">

<div class="wrapper">

<div class="breadcrumbs">
<a href="catalog.php">Full Catalog</a>
  &gt; <a href="catalog.php?cat=<?php echo $item["catalog"]; ?> ">
  <?php echo $item["category"]; ?></a>
  &gt; <?php echo $item["title"]; ?>

</div>
<div class="media-picture">

<span><img src="" <?php echo $item["img"]; ?>" alt="<?php echo $item["title"]; ?>"/>

</span>

</div> </div class="media-details">

<h1><?php echo $item["title"]; ?></h1> <table> <tr> <th>Category</th> <td><?php echo $item["category"]; ?></td> </tr> <tr> <th>Genre</th> <td><?php echo $item["genre"]; ?></td> </tr> <tr> <th>Format</th> <td><?php echo $item["format"]; ?></td> </tr> <tr> <th>Year </th> <td><?php echo $item["year"]; ?></td> </tr> <?php if (strolower($item["category"]) == "books") { ?> <tr> <th>Author</th> <td><?php echo $item["author"]; ?></td> </tr>
<tr> <th>Publisher</th> <td><?php echo $item["publisher"]; ?></td> </tr> <tr> <th>Isbn</th> <td><?php echo $item["isbn"]; ?></td> </tr> <tr>

<?php }?>

  </table>
Martina Carrington
Martina Carrington
15,724 Points

Details.php <?php include("inc/data.php"); include("inc/functions.php");

$pageTitle = "Full Catalog"; $section = null;

if(isset($_GET["id"])) { $id = $_GET["id"]; if (isset($catalog[$id])){ $item = catalog[$id];

}

} if(!isset($item)){ header("localtion:catalog.php"); exit; }

pageTitle = $item["title"]; $section = null;

include("inc/header.php"); ?>

<div class="section page">

<div class="wrapper">

<div class="breadcrumbs">
<a href="catalog.php">Full Catalog</a>
  &gt; <a href="catalog.php?cat=<?php echo $item["catalog"]; ?> ">
  <?php echo $item["category"]; ?></a>
  &gt; <?php echo $item["title"]; ?>

</div>
<div class="media-picture">

<span><img src="" <?php echo $item["img"]; ?>" alt="<?php echo $item["title"]; ?>"/>

</span>

</div> </div class="media-details">

<h1><?php echo $item["title"]; ?></h1> <table> <tr> <th>Category</th> <td><?php echo $item["category"]; ?></td> </tr> <tr> <th>Genre</th> <td><?php echo $item["genre"]; ?></td> </tr> <tr> <th>Format</th> <td><?php echo $item["format"]; ?></td> </tr> <tr> <th>Year </th> <td><?php echo $item["year"]; ?></td> </tr> <?php if (strolower($item["category"]) == "books") { ?> <tr> <th>Author</th> <td><?php echo $item["author"]; ?></td> </tr>
<tr> <th>Publisher</th> <td><?php echo $item["publisher"]; ?></td> </tr> <tr> <th>Isbn</th> <td><?php echo $item["isbn"]; ?></td> </tr> <tr>

<?php }?>

  </table>

2 Answers

Rebecca Mooneyham
Rebecca Mooneyham
9,912 Points

You have the word catalog in this line and it should be category.

&gt; <a href="catalog.php?cat=<?php echo $item["catalog"]; ?> ">
&gt; <a href="catalog.php?cat=<?php echo $item["category"]; ?> ">