|
<code>
function show_ads($number_of_ads=1){
global $ad;
if($number_of_ads > count($ad)){
$number_of_ads = count($ad);
}
list($usec, $sec) = explode(' ', microtime());
srand((float) $sec + ((float) $usec * 100000));
$rand_keys = array_rand($ad, $number_of_ads);
$show_ads = "<table><tr>";
for($i=0; $i<$number_of_ads; $i++){
$e = $ad[$rand_keys[$i]];
$show_ads .= "
<td width='300px'>
<a href='{$e[3]}' style='font:13px Arial; font-weight:bold; color: #0000ff'>{$e[0] }</a><br>
</td>
";
}
$show_ads .= "</tr></table>";
echo $show_ads;
}
?>
</code>
I am trying to set up an add rotator which is called from within a div in each page. The div's width is set to 300px but it seems that the ads shown dont follow the width rule and just get out of line.
In the code there's a <td width='300px'> which it does not seem to follow either.
I am new to php and don;t know what to do to be honest.
Last edited by Claudius; 10-10-2008 at 05:48 AM..
|