Page displaying well in all web browsers but IE?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ThatPerson
Forum Commoner
Posts: 50
Joined: Wed Aug 03, 2011 1:57 am

Page displaying well in all web browsers but IE?

Post by ThatPerson »

Recently I was developing a new website, and got it perfect in Firefox, Chrome, Opera, Epiphany, Midora, yet Internet Explorer (All versions) push it to the side. I am having a release hopefully tommorow, and was wondering if anyone could see the issue. To see what it looks like, visit swarm.bentatman.co.uk/beta.php in Firefox and Internet Explorer to see the differences. Any help will be greatfully appreciated.

Code: Select all

<?php
include("database.php");
ob_start();
$pagetest = mysql_query("select count(*) as count from swarm_wiki");
$pages = mysql_fetch_object($pagetest)->count;
$pagenum = intval($pages);
echo <<<END
	<head>
		<title>Crimson Swarm</title>
		<style type="text/css">
			body {
			background:url('images/backgroundNew.jpg') no-repeat;
z-index:-1;
			background-size:100%;
			}
		</style>
	</head>
END;
echo <<<end
	<div style = "overflow:auto;height:60px;right:0px;left:0px;bottom:0px;position:absolute;background:url('images/grassNew.jpg') no-repeat; background-size:100%;z-index:1;">
end;
$p = 0;
$times = 5-$pagetest;
for ($i = 1; $i <= $pagenum; $i++) {
	$p = $p+1;

	${note.$p."title"} = mysql_fetch_object(mysql_query("select Name from swarm_wiki where ID = '$p'")) ->Name;
	${note.$p."text"} = mysql_fetch_object(mysql_query("select Text from swarm_wiki where ID = '$p'")) ->Text;
	$title = ${note.$p."title"};

	$text = ${note.$p."text"};
	$pos = 200*($p-1);
	$submit = "Submit".$p;

echo <<<END
<FORM NAME ="form1" METHOD ="POST" ACTION = "beta.php">
	<div style = "height:50px;width:200px;position:absolute;left:$pos;bottom:0px;">
		<INPUT style = "position:inherit;height:100%;width:100%;background:url('images/buttonNew.jpg') no-repeat;background-size:100%;top:0px;left:0px;" value = "$title" name = "$submit" type="Submit">
	</div>
END;
}


$p = 0;
$times = 5-$pagetest;
for ($i = 1; $i <= $pagenum; $i++) {

	$p = $p+1;

	$submit = "Submit".$p;



	if (isset($_POST[$submit])) {

		setcookie("page", $p, time()+60*60*24*10, "", "");
echo <<<end

	<head>
		<meta HTTP-EQUIV="REFRESH" content="0; url='beta.php'">
	</head>
end;
}
}

echo "</div>";
echo "</div>";
echo "<div style = 'left:0px;right:0px;height:100%;top:0px;bottom:0px;position:absolute;'>";
echo "<img src = 'images/messageNew.jpg' style='width:80%;left:10%;right:10%;top:0px;height:100%;position:absolute;z-index:-1;'></img>";
echo "<div style = 'left:20%;overflow: auto;width:80%;top:0px;bottom:60px;position:absolute;background:url('images/messageNew.jpg') no-repeat;background-size:100%;z-index=1;'>";



echo "<img src='images/TheCrimsonSwarm.png' style='left:25%;top:0px;position:inherit;width:304px;height:150px;'></img>";

echo <<<END
</div>
<div style="overflow:auto;top:150px;position:absolute;left:10%;bottom:60px;right:10%;">
END;
if (isset($_COOKIE['page'])) {

$p = $_COOKIE['page'];
$text = eval(${note.$p."text"});
$title = ${note.$p."title"};

echo <<<END


<div style="top:150px;left:0px;right:0px;width:100%;position:inherit;background:url('images/messageNew.jpg') no-repeat;background-size:100%;">

$text
</div>
END;
} else {
$text = eval($note1text);
$title = $note1title;

echo <<<END


<div style="top:150px;left:0px;right:0px;width:100%;position:inherit;background:url('images/messageNew.jpg') no-repeat;background-size:100%;">
$text
</div>
END;
}

echo "</div>";

ob_flush();
?>
Can anyone see any issues? It may be because of the overflow or the positions, but I have no ideas.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Page displaying well in all web browsers but IE?

Post by Celauran »

This isn't valid HTML. No doctype declaration, no html tags, no body tags. That alone should address some of the issues you're having.
ThatPerson
Forum Commoner
Posts: 50
Joined: Wed Aug 03, 2011 1:57 am

Re: Page displaying well in all web browsers but IE?

Post by ThatPerson »

What, so if I added the doctype declaration at the top, and the HTML tags, it should work? I am just about to test it...
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Page displaying well in all web browsers but IE?

Post by Celauran »

It won't be perfect (it's IE after all...), but just adding a doctype and the missing tags made a significant improvement when I tested it.
ThatPerson
Forum Commoner
Posts: 50
Joined: Wed Aug 03, 2011 1:57 am

Re: Page displaying well in all web browsers but IE?

Post by ThatPerson »

Yep, I added it, and now it has the items in the correct location, but the buttons along the bottom do not display correctly. It only shows the 'What is this Wiki?' page. I cannot see any issues in this part:

Code: Select all

$p = 0;
$times = 5-$pagetest;
for ($i = 1; $i <= $pagenum; $i++) {
	$p = $p+1;

	${note.$p."title"} = mysql_fetch_object(mysql_query("select Name from swarm_wiki where ID = '$p'")) ->Name;
	${note.$p."text"} = mysql_fetch_object(mysql_query("select Text from swarm_wiki where ID = '$p'")) ->Text;
	$title = ${note.$p."title"};

	$text = ${note.$p."text"};
	$pos = 200*($p-1);
	$submit = "Submit".$p;

echo <<<END
<FORM NAME ="form1" METHOD ="POST" ACTION = "beta.php">
	<div style = "height:50px;width:200px;position:absolute;left:$pos;bottom:0px;">
		<INPUT style = "position:inherit;height:100%;width:100%;background:url('images/buttonNew.jpg') no-repeat;background-size:100%;top:0px;left:0px;" value = "$title" name = "$submit" type="Submit">
	</div>
END;
}
The code just posted is the loop which places the buttons.
Only displays the last item. I suppose it is IE after all, but quite a few people still use Internet Explorer, so I might as well make it work for them.

Thanks for your help though.
Post Reply