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 trialIra Salem
10,331 PointsIssues with header.php
I'm having issues with my header.php file loading up correctly to the webpage. When Randy Hoyt in the video his page looks the way it should. When I refresh mine I get a white background with all of the pictures still there.
Help!
Ira Salem
10,331 PointsHere is the link code used in both the index.html and contact.php
<p>?php include('inc.header.php'); ?></p>
I had to remove the "less than symbol" symbol so it would appear but it would be in front of the code.
1 Answer
Cosmin Cioaclă
21,339 PointsHi Ira,
Looking at your code, I see that you are missing the opening html tag, as well as the head, /head and body tags.
The whole thing should be in a file called header.php situated in a folder called inc. To include that in your index.php page, you would have the following line at the begining of your file:
<?php include('inc/header.php'); ?>
Make sure your index has the .php extension, not .html.
Hope that helps, Cosmin
Ira Salem
10,331 PointsIra Salem
10,331 PointsHere is my header.php
<html> <head> <title>Shirts 4 Mike</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>