<?
include 'config/bd.php';
$res = mysql_query("SELECT * FROM banner WHERE active = 1 ORDER BY RAND() LIMIT 1 ");
$arr = mysql_fetch_array($res);
$url = $arr['url'];
$img = $arr['img'];
$title = $arr['title'];
echo "<a rel='nofollow' href='$url' target='_blank'>
<img src='$img' title='$title'>
</a>";
?>