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

PHP redirecting after a form submission, Layout problem, footer comes up...

Hi! I'm having a problem with the layout in the build a simple php application. The footer comes up.. anyone who knows what the problem is? it's also happening in the shirts page...

<?php

$name = $_POST["name"]; $email = $_POST["email"]; $message = $_POST["message"]; $email_body = ""; $email_body = $email_body . "Name: " . $name . "\n"; $email_body = $email_body . "Email: " . $email . "\n"; $email_body = $email_body . "Message: " . $message;

//TO DO: SEND EMAIL

$pageTitle = "Contact Mike"; $section = "contact"; include("inc/header.php");

?>

<div class="section page">
    <div class="wrapper">

        <h1>Contact </h1>
        <p> Thanks for the email! I&rsquo;ll be in touch shortly.</p>
    </div>
</div>

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

6 Answers

Ah, that's your answer, I think. There's no CSS or other formatting to "push" the footer down, so it floats up as high as it can. That's a good thing, because after you add content in the middle, the footer will float down.

Diana,

First, make sure the footer.php is in the inc directory. If it is, then the problem's the format of the file link. forward slash before?

Hi James, thanks :)

Yes, it's inside the inc directory and the links are like this <?php include('inc/footer.php'); ?>

Diana, is the problem that the footer doesn't appear? can you clarify what the error message is?

there is no error message, it's only poorly located, right in the middle of the page.... looking fairly ugly. it's only happening in the (thank you) contact page and the shirts page because they have few text in them.

ups :D I had thought about that but as in the video the footer was down I thought I had a code problem :D Thanks James! :)