Jump to content

Code Only Works In Some Browsers??


raryre23

Recommended Posts

I'm a relative beginner to PHP and cant work out what is going on here!! I have some code which works fine in Firefox and Safari but when I tried it on Internet Explorer it doesn't display an image like it does in the other two but it displays nothing. If someone could help me out it would be appreciated!

 

<?php
$sql="select * from ratepics where (username= '$username' AND '$hname' = hname)";
$result=mysql_query($sql);
$obj=mysql_fetch_object($result);
$thumburl=$obj->thumburl; 
$url=$obj->url; 
$id=$obj->id; 
if(mysql_num_rows($result) > 0 ) {

?>
        <div align="center">
          <p><a href= '' onClick="MM_openBrWindow('<?php print $url?>','','')" ><img src="<?php print $thumburl ?>" alt="" name="" width="" height="" border="0"></a></p>
          <p> </p>
      </div></td>

 

 

Link to comment
https://forums.phpfreaks.com/topic/99979-code-only-works-in-some-browsers/
Share on other sites

This is not a PHP problem, this is a problem in the differences between how some browsers interpret HTML code.

 

Specifically the problem is that you are using the height & width parameters, but not giving them any values. IE is interpreting this as if you had set the values to 0. Just remove them, don't understand why you would include the parameters if you don't use them anyway.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.