Problem with dynamic php include -- SOLVED --
Posted: Thu Dec 17, 2009 4:43 am
Hi there
I am using the below code on a test.php page just before I start building the actuall website. The problem I encountered was with IE6 and IE7 where a gap appears just before the actual content. When viewing the source code with IE8 developer tool, I see a small box as (?). Basically this creates a space just before the content and I am sure this will cause some problems in the future. Is something I'm doing wrong?
Note: there is no problem with IE8 and firefox.
You can see what I'm talking about at:
http://www.bridegroom.0fees.net/test.php?page=home
and
http://www.bridegroom.0fees.net/test.php?page=contact
Cheers!!!
I am using the below code on a test.php page just before I start building the actuall website. The problem I encountered was with IE6 and IE7 where a gap appears just before the actual content. When viewing the source code with IE8 developer tool, I see a small box as (?). Basically this creates a space just before the content and I am sure this will cause some problems in the future. Is something I'm doing wrong?
Note: there is no problem with IE8 and firefox.
You can see what I'm talking about at:
http://www.bridegroom.0fees.net/test.php?page=home
and
http://www.bridegroom.0fees.net/test.php?page=contact
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Homepage | <?php echo $_GET['page']; ?> </title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<?php
$page = strip_tags($_GET['page']);
if (!$page) {
$include = 'home.php';
include ($include);
}
else {
$include = ''.$page.'.php';
include ($include);
}
?>
</body>
</html>