            <?
             $css="select * from banners where status = 'default' or status='ad' ";
	         $css_res=mysql_query($css);
             $ban_count=mysql_num_rows($css_res);
	         $i=1;
while($css_row=mysql_fetch_array($css_res))
	        {
						
               $ban_auto[$i] = 	$css_row[banner_id];
$i++;
            }
$i=$i-1;
$n = rand(1,$i);

$css="select * from banners where banner_id='$ban_auto[$n]'";
   $css_res=mysql_query($css);
$css_row=mysql_fetch_array($css_res);
$site_url= $css_row[site_url];
$path = $css_row[banner_path];
?>
<?
$css2="select options as op from options where auto=4";
   $css_res2=mysql_query($css2);
$css_row2=mysql_fetch_array($css_res2);
$options= $css_row2[op];
?>
<?if(($ban_count>0)&&($options!="no")){ ?>
<tr><td align="center" style="padding-top:10px;">

<a href="<?php echo "$site_url"; ?>" id=sds target="_blank" > 
<img name=test src="<?php echo "$path"; ?>" border=0>
</a></td>
<? } ?>

