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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.