Forum Moderators: coopster

Message Too Old, No Replies

Image problem in ie with PHP

         

alex123

8:49 am on May 12, 2005 (gmt 0)

10+ Year Member



Hi there,

I have an image problem in IE only when I call up a series of images over PHP to sit in a table cell. The images dont wrap once they hit the table wall of say 80% - thet just carry on on one line and force the browser to horizontal sccroll which is bad. Note in every other browser the images wrap when needed to.

Here is the php code and html.

<?
include('connection.php');
include('variables.php');

$sql = "SELECT DISTINCT manufacturer FROM tbl_manufacturer WHERE status=1 AND id NOT BETWEEN 57 and 63 ORDER BY RAND() LIMIT 12";
$sql_result = mysql_query($sql);
$sql_count = mysql_num_rows($sql_result);
//may need to limit to fewer in smaller browser
//echo $sql_count;
?>


<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td align="center">
<? while ($result = mysql_fetch_array($sql_result)) { $manid = str_replace(" ", "%20", $result[0]);?>
<a href="<?=$root;?>/pages/category.php?man_id=<?=$manid;?>"><img src="<?=$root;?>/pages/images/<?=$manid;?>.jpg" alt="<?=$result[0];?>" title="<?=$result[0];?>" hspace="1" vspace="1" border="0"></a>&nbsp;<?
echo "\n ";
$yz++;
if ($yz % 3 == 0) { echo "<br>"; }
}
?>
</td>
</tr>
</table>

Note that this piece of the code

if ($yz % 3 == 0) { echo "<br>"; }

forces a new line after 3 logos are called up which is not ideal as it looks a little stupid.

Here is the page where you will find this code at work - unles my partner has changed it - either way you will see the logos near the top of the page - these are the issue.

Any ideas how to get them to react in ie the same as they do elsewhere?

ta

Alex

kazecoder

10:16 am on May 12, 2005 (gmt 0)

10+ Year Member



Alex - I would like you to run the actual script and click on view source in IE. Then post that code here because I want to see the actual output.

ergophobe

3:45 pm on May 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, this is an HTML question. Any time something looks one way in one browser and look another way in another browser, you can be fairly sure that's not a PHP issue.

What you need to do is take the HTML that PHP generates, save it to an HTML file, mess with it in an editor or even a WYSIWYG HTML editor until it looks right in all browsers, and *then* figure out what PHP code you need to use to generate that HTML.

As a first step, run your page through the W3C validator.