Topic: affiliates mod and my banner.php

I would like to take and put these two files together.

this is the affiliates.php from the include/user/affiliates.php

<?php
        
        $affiliate_result = $db->query("SELECT * FROM ".$db->prefix."affiliates WHERE disabled=0 ORDER BY count_in DESC") or error("Affiliate error: ",__FILE__, __LINE__, $db->error());
        $affiliate_num = $db->num_rows($affiliate_result);
        ?>
        <ul>
        <?php
        if($affiliate_num > 0)
            {
            
            while($affiliate_row = $db->fetch_assoc($affiliate_result))
                {
                    if ($affiliate_row['site_image'] == '')
                    echo "<li><a href=\"affiliates.php?out=" . $affiliate_row['id'] . "\">" . $affiliate_row['site_name'] . "</a></li>";
                    else
                    echo "<li><a href=\"affiliates.php?out=" . $affiliate_row['id'] . "\"><img src=\"" . $affiliate_row['site_image'] . "\" /></a></li>";
                }
            }
        ?>
        </ul>

this is my banner.php that also inside the include/user/banner.php

<?php

$option = "banner";

$sites[0] = array("http://www.BiCupid.com", "The perfect and largest dating site for  Bisexual and Bicurious singles in the  world", 2, "http://images.bicupid.com/bc/banner-468.gif");

$sites[1] = array("http://www.swinglifestyle.com/?signup=whatyourname", "Swingers", 2, "http://www.swinglifestyle.com/login/swinger5.gif");
$sites[2] = array("http://www.loungeparties.com", "Loungeparties is a unique exclusive London based swinger?s community.", 2, "http://www.loungeparties.co.uk/com_imgs/banners/lp/loungeparties-banner.jpg");
$sites[3] = array("http://justswinger.com", "free online swinger?s community.", 2, "http://justswinger.com/banner.gif");
$sites[4] = array("http://realgirlsoncam.com/alyssa", "alyssa webcam!", 2, "http://justswinger.com/alyssa.gif");

$countsites = count($sites);

for($i=0; $i<$countsites; $i++)
    {
    for($x=0; $x<$sites[$i][2]; $x++)
        {
        if($option != null)
            {
            $mylist[] = array($sites[$i][0],$sites[$i][1],$sites[$i][3]);
            }
        else
            {
            echo("Error deciding option.");
            exit();
            }
        }
    }

$countlist = count($mylist);

$countlist = $countlist - 1;

$picker = rand(0, $countlist);

if($option == "link")
    {
    echo("<a href='" . $mylist[$picker][0] . "'>" . $mylist[$picker][1] . "</a>");
    }

else if($option == "banner")
    {
    echo("<a href='" . $mylist[$picker][0] . "'><img alt='" . $mylist[$picker][1] . "' src='" . $mylist[$picker][2] . "' /></a>");
    }

else
    {
    echo("Error deciding option.");
    exit();
    }



?>

i want to tie the two together so that the banner.php displays the banner and affiliates.php keeps count of the in and out?


help anyone?


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!