Results 1 to 6 of 6

Thread: PHP and Browsers

  1. #1
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry PHP and Browsers

    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

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Brooks
    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

  3. #3
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    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

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Brooks
    I don't use style sheets but here is the address of the html file: http://www.leesburgbaptist.org/html/left.html
    I'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,

    HTML Code:
    <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.

  5. #5
    Join Date
    Apr 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Why not use php include instead of Iframe?

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

  6. #6
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by DNCamper
    Why not use php include instead of Iframe?

    Code:
    <?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

    linked page:

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

    With an iframe, the result is

    Code:
    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

    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •