Hi.

I'm trying to modify some PHP code (actually, the HTML section inside it) to set the background as transparent, so the displayed text shows the website's template's background beneath the text. It works great in Firefox, Safari and even Chrome, but in IE7 the background is solid white no matter what I do.

I've finally given up on trying to make IE display it the way I want and tried using a conditional statement to set the background to a solid, dark color in IE 7 and above (I don't trust 8 to work, either), but I can't even get that to work! This is really frustrating. How can I make this work so IE7 users can at least see the text?

Here's the URL in question:
http://www.aon-network.com/now-playing.html

and here's the code as I've modified it:

<?php
header("Refresh: 30;");
?>

<?php
include("includes.php");
?>
<HTML>
<TITLE>AoN Network Radio Status</TITLE>
<BODY <bgcolor transparency="0">
<!--[if gte IE 7]>
<BODY <bgcolor="1F1F1F">
<![endif]-->
<TABLE align="center" width="95%">
<TR><TD><font face="Arial" color="FFFFFF" size="3">
Current Song: <b><?php echo $current_song; ?></b><br>
Current Show:  <b><?php echo $server[0]['desc']; ?></b><br>
Listeners: <?php echo $listeners; ?>/<?php echo $max_listeners; ?><br><br></font><TD><TR>
</TABLE>

<?php
$i = 0;
echo "<table align=\"center\" width=\"60%\">
<tr>
<td rowspan=\"".sizeof($lastsong)."\" valign=\"top\"><font face=\"Tahoma\" color=\"F2F2F2\" size=\"1\">Previous ".sizeof($lastsong)." Ch00000ns:</font></td>";
while ($lastsong[$i])
{
	if ($i != 0)
	{
		echo "<tr>";
	}
	echo "<td><font face=\"Tahoma\" color=\"D9D9D9\" size=\"2\">";
	echo $lastsong[$i];
	echo "</font></td></tr>";
	$i++;
}
echo "</TABLE>";

?>
</BODY>
</HTML>

motter, in your iframe, example2.php,

<BODY <bgcolor="1F1F1F">

should be

<body bgcolor="1F1F1F">

Also, you should validate your code with W3C if you expect to have a cross browser compliant site.

Thanks, and drat! :) That's what happens when you get frustrated, I guess- you miss things like that which make all the difference. It's working now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.