Page 1 of 1

Script not showing in IE

Posted: Sun May 14, 2006 1:14 pm
by Maluendaster
I have a site that looks fine in firefox, but in IE the script part doesn't show.. (its a image randomizer)


what's wrong??

Here's the site : http://www.musicspot.cl

here's the php code of the randomizer (it's inside of an IFRAME)

<body leftmargin="0" topmargin="0">

Code: Select all

<?php
   $width = '299';
   $height = '245';

	
    $Ad[0] = '<a href="link1" id="link1" target=_blank><img src="imgs_locales/1.jpg" width=$width height=245 alt="link 1" border="0" id="link_1" /></a>';
    $Ad[1] = '<a href="link2" id="link2" target=_blank><img src="imgs_locales/2.jpg" width=$width height=245 alt="link 2" border="0" id="link_2" /></a>';
    $Ad[2] = '<a href="link3" id="link3" target=_blank><img src="imgs_locales/3.jpg" width=$width height=245 alt="link 3" border="0" id="link_3" /></a>';
    $Ad[3] = '<a href="link4" id="link4" target=_blank><img src="imgs_locales/4.jpg" width=$width height=245 alt="link 4" border="0" id="link_4" /></a>';
    $Ad[4] = '<a href="link5" id="link5" target=_blank><img src="imgs_locales/5.jpg" width=$width height=245 alt="link 5" border="0" id="link_5" /></a>';
       
    $Weight[0]=1;
    $Weight[1]=1;
    $Weight[2]=1;
    $Weight[3]=1;
    $Weight[4]=1;
    $Weight[5]=1;
    $sum =0;
    for($i=0;$i<count($Weight);$i++)
    	$sum+=$Weight[$i];
    $ShowAd = rand(0, $sum - 1);
    for($i=0;$i<count($Weight);$i++)
    {
    	if($ShowAd<=$Weight[$i])
    	{
    		$ShowAd=$i;
    		break;
    	}
    	else
    		$ShowAd-=$Weight[$i];
    }
    echo $Ad[$ShowAd];
    ?>

Re: Script not showing in IE

Posted: Sun May 14, 2006 2:09 pm
by aerodromoi
Maluendaster wrote:I have a site that looks fine in firefox, but in IE the script part doesn't show.. (its a image randomizer)


what's wrong??

Here's the site : http://www.musicspot.cl

here's the php code of the randomizer (it's inside of an IFRAME)

<body leftmargin="0" topmargin="0">
No wonder the MSIE does not display it properly

Code: Select all

<body leftmargin="0" topmargin="0"> 
   <a href="link2" id="link2" target=_blank><img src="imgs_locales/2.jpg" width=$width height=245 alt="link 2" border="0" id="link_2" /></a>
Is this supposed to be html? :?

First of all, you need an html tag, quotation marks for attributes, you have to close tags as well (body)....

btw:

Code: Select all

width="'.$width.'" height="'.$height.'"
Mucha suerte,
aerodromoi

Posted: Sun May 14, 2006 5:47 pm
by Maluendaster
thank you!

Posted: Sun May 14, 2006 10:26 pm
by aerodromoi
Just an idea: Why don't you include the script in the main page?
Using an iframe seems a bit overdone to me.

aerodromoi