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 Simple PHP Application Creating the Menu and Footer Adding Active States to the Navigation

Getting a Blank Page

I am getting a blank webpage for contact page.

Here is my header.php file. <html>

<head>

    <title> <?php echo $pageTitle; ?> </title>

    <link rel="stylesheet" href="css/style.css" type="text/css">

    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,700" type="text/css">

    <link rel="shortcut icon" href="favicon.ico">

</head>

<body>

    <div class="header">

        <div class="wrapper">

            <h1 class="branding-title"> <a href="./">Shirts 4 Mike </a> </h1>

            <ul class="nav">

                <li class="shirts <?php if ($section == "shirts") { echo "on"; } ?>"> <a href="shirts.php"> Shirts </a> </li>

                <li class="contact <?php if ($section == "contact") { echo "on"; } ?>"> <a href="contact.php"> Contact </a> </li>

                <li class="cart"> <a href="#"> Shopping Cart </a> </li>

            </ul>

        </div>

    </div>

    <div id="content">

Then here is my contact.php file. <?php

$pageTitle = "Contact Mike";

$section = "contact";

include "INC/header.php"; ?>

<div class="section page">

    <h1> Contact </h1>

</div>

<?php include ('INC/footer.php'); ?>

2 Answers

The INC is capitalized in the directory I figured it out, I was missing the parehtnsis between the INC though.

The first thing I notice in contact.php

include "INC/header.php"; 

is that INC is capitalized is the directory in all caps as well, or is it called "inc?" To troubleshoot the problem beyond that, we need to see some errors instead of a blank page. The following code will turn all error reporting on. I would recommend adding it to contact.php before any other code:

ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);

this potentially will tell you exactly where the error is happening in your code. If you aren't sure how to read the error message you get, go ahead and paste the error into a reply!