I have the following code and I have placed it in my main.html page. I do not know how to call the function showbanners.
What am I doing wrong???
Thanks
Z
Code:
<?
function show_banners()
{
//get the banners
$q1 = "select * from platinum_banners order by rand() limit 0,5";
$r1 = mysql_query($q1) or die(mysql_error());
$b = mysql_num_rows($r1);
if($b < '5')
{
for($bb = '1'; $bb <= (5 - $b); $bb++)
{
$banners .= "<td align=center width=154 height=70><a href=\"contact_us.php\"><img src=\"ad_here.gif\" border=1 style=\"border-color:black\"></a></td>\n\t";
}
}
while($a1 = mysql_fetch_array($r1))
{
$banners .= "<td align=center width=154 height=70><a href=\"$a1[BannerURL]\" target=_blank><img src=\"banners/$a1[BannerFile]\" border=0 width=120 height=60></a></td>\n\t";
}
$banners .= "</tr>\n</table>\n\n";
return $banners;
}
?>
<table border="0" cellpadding="0" cellspacing="0" width="770" class="pg" bgcolor="#ffffff">
<tr>
<td width="10" valign="top"><?=show_banners();?></td>
Thanks
Z