Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Basic PHP Website (2018) Building a Media Library in PHP Working with _GET Variables

Zachary Trump
Zachary Trump
1,647 Points

is it possible to start the workspace over? i messed up somewhere and im not getting the individual page titles.

Ive looked everything over several times and i just cant figure out where i messed up.

Zachary Trump
Zachary Trump
1,647 Points

catalog.php

<?php $pageTitle = "Full Catalog";

if ($_GET["cat"] == "books") { $pageTitle = "Books"; } else if ($_GET["cat"] == "movies"){ $pageTitle = "Movies"; } else if ($_GET["cat"] == "music"){ $pageTitle = "Music"; }

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

<div class="section page"> <h1><?php $pageTitle; ?></h1> </div>

<?php include("inc/footer.php"); ?>

Zachary Trump
Zachary Trump
1,647 Points

header.php <html> <head> <title><?php echo $pageTitle; ?></title> <link rel="stylesheet" href="css/style.css" type="text/css"> </head> <body>

<div class="header">

    <div class="wrapper">

        <h1 class="branding-title"><a href="/">Personal Media Library</a></h1>

        <ul class="nav">
            <li class="books"><a href="/catalog.php?cat=books">Books</a></li>
            <li class="movies"><a href="/catalog.php?cat=movies">Movies</a></li>
            <li class="music"><a href="/catalog.php?cat=music">Music</a></li>
            <li class="suggest"><a href="suggest.php">Suggest</a></li>
        </ul>

    </div>

</div>

<div id="content">
Zachary Trump
Zachary Trump
1,647 Points

index.php

<?php $pageTitle = "Personal Media Library";

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

    <div class="section catalog random">

        <div class="wrapper">

            <h2>May we suggest something?</h2>

            <ul class="items">
                <li>
        <a href="#">
          <img src="img/media/forest_gump.jpg" alt="Forrest Gump">
          <p>View Details</p>
        </a>
      </li>
      <li>
        <a href="#">
          <img src="img/media/princess_bride.jpg" alt="The Princess Bride">
          <p>View Details</p>
        </a></li>
      <li>
        <a href="#">
          <img src="img/media/elvis_presley.jpg" alt="Elvis Forever">
          <p>View Details</p>
        </a>
      </li>
      <li>
        <a href="#">
          <img src="img/media/garth_brooks.jpg" alt="No Fences">
          <p>View Details</p>
        </a>
      </li>                             
            </ul>

        </div>

    </div>

<?php include("inc/footer.php"); ?>

1 Answer

The only way I know of is to delete it. Close the workspace, then go into "Workspaces" (You should see the "Workspaces" button at the top of the screen, on the right side). When you click on that, you will see a list of all the workspaces you have used. Click on the garbage can icon for the one you don't like, and it will be deleted. Then, the next time you open the workspace, you should get a new workspace.