Click to See Complete Forum and Search --> : PHP Includes Messed up in IE7


risingPhoenix
04-28-2008, 10:21 PM
I need help! My PHP web page looks messed up in IE7 when I added includes and I want to fix that.

I'm in a PHP class and am converting a web page from XHTML to PHP using PHP includes. Yet, when you view the new PHP web page in IE7 the design looks messed up:

http://mattjennings.net/002natalie/index.php

When you view the original XHTML web page in IE7 there is no problem:

http://mattjennings.net/002natalie/index.html

I've validated index.html and the source code of index.php as both XHTML Strict 1.0 and used Dreamweaver CS3 to hand code index.php.

Below is the code on index.php:


<!-- HEADER INCLUDE START -->
<?php
include('includes/headerINC.php');
?>
<!-- HEADER INCLUDE END -->

<img src="images/img101-home-md.jpg" width="400" height="300" alt="Old Rainier Brewery - SoDo" />

<div class="description-float">Old Rainier Brewery - SoDo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div>Currently Public Building</div></div>

<div class="description-float">Starbucks Tower - SoDo</div>

<!-- LEFT end DIV -->
</div>

<div id="right">

<div id="text-main">

<h2>About</h2>

<p>
Natalie Ramsey’s paintings represent significant landmarks and architecture of the Seattle area. They narrate important events in Seattle’s history while addressing current issues related to growth and the constantly changing faces of neighborhoods.
</p>
<br />

<p>
<a href="gallery/gallery.html">Public Architecture Gallery</a>
</p>

<!-- HOME-SPOTLIGHT INCLUDE START -->
<?php
include('includes/home-spotlightINC.php');
?>
<!-- HOME-SPOTLIGHT INCLUDE END -->

<!-- FOOTER INCLUDE START -->
<?php
include('includes/footerINC.php');
?>
<!-- FOOTER INCLUDE END -->


Any help would be appreciated about how I can fix my PHP web page so that it looks good in IE7! :(

chazzy
04-29-2008, 08:25 AM
it's not valid XHTML. You're missing a few </div> in there. Firefox is simply giving you the benefit of the doubt when you view it.

risingPhoenix
04-29-2008, 07:51 PM
I solved the problem! I just moved the DOCTYPE out of an include file and into my index.php file. Now the website looks fine in IE7.

Also, the web page is valid XHTML 1.0 Strict and I haven't missed a </div>. I've tested using the W3C's online validator multiple times.

shmoo525
04-29-2008, 08:37 PM
I think chazzy was just referring to your snippet of code that you posted here, which is in fact missing 2 </divs> :) I'm sure your full page has all the tags in it, though.

Anyway, that is interesting about the DOCTYPE... I'll have to keep that one in mind. Thanks for posting your solution!