PDA

View Full Version : PHP and Browsers



Brooks
04-03-2005, 03:43 PM
I created a PHP script that would return five small images. I specified the exact size including border information. Firefox displays it correctly but IE6 does not. IE6 creates a white box around the image and puts the image in the lower part of the box. My web page does not have a white background so I get a white zone around each image. I've tried specifying the images size in a table entry in the main html but nothing works. Any hints?

Brooks

mwinter
04-04-2005, 02:51 PM
I created a PHP script that would return five small images. [...] IE6 creates a white box around the image and puts the image in the lower part of the box. [...] Any hints?The use of PHP is irrelevant. Rendering errors will be caused by mark-up or style sheet issues. However, seeing neither makes it difficult to suggest anything.

Mike

Brooks
04-07-2005, 12:51 PM
I don't use style sheets but here is the address of the html file: http://www.leesburgbaptist.org/html/left.html

The key item is:

<tr>
<table col="2" width="120" height="34">
<tr>
<td width="30" height="34">&nbsp;</td>
<td width="90" height="34">
<iframe width="85px" height="34px" scrolling="no" frameborder=0 src="html_result.php"></iframe>
</td>
</tr>
</table>
</tr>

Hope this helps.

Brooks

mwinter
04-08-2005, 10:58 AM
I don't use style sheets but here is the address of the html file: http://www.leesburgbaptist.org/html/left.htmlI'm afraid it seems that IE is just being a royal pain in the ass. It refuses, via any means, to make the iframe fit properly.

I think you have two options: integrate the PHP code into the containing page and remove the iframe, or place a background on the iframe[1] to disguise IE's inadequacies.

If you take the latter (and I think I'd prefer the former), it might be easier to switch to a CSS layout. You should be able to control the positioning more precisely, and thereby line up the background properly. For example,


<style type="text/css">
body {
background: #f6f2da url(../images/tile.jpg) -34px -6px;
color: black;
}
</style>applied within the iframe (that is, the PHP output) would tile the background offset 34 pixels to the left of the left edge, and six pixels above the top edge. Assuming that's where the nearest instance of the tiled image begins, the iframe shouldn't be descernable as the background would flow seamlessly.

Hope that helps,
Mike


[1] Ideally, you could just set the background-color CSS property to transparent, but IE is having none of that, either.

DNCamper
04-08-2005, 04:27 PM
Why not use php include instead of Iframe?


<?php include("path to your file");?>

cr3ative
04-08-2005, 06:18 PM
Why not use php include instead of Iframe?


<?php include("path to your file");?>

AFAIK, a php include just dumps the code into your page. If the OP wants a width restriction on the code (i.e to put it in a box), this wouldn't work at all.

Let me try to explain :o

linked page:

Text which is spanning a wide distance. Text which is spanning a wide distance.

With an iframe, the result is



Text which is spanning
a wide distance. Text
which is spanning a wide
distance.

But with an include, it would literally just paste the whole sentence, in a line.

I can't really explain any further, I hope someone understands me :rolleyes:

cr3ative