1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Sorting question

Discussion in 'PHP' started by -jay-, Mar 9, 2008.

  1. #1
    hello . just hoping i can get help on a question by fellow dp members.


    I have a custom MGP site. i want to load the movies randomly. any idea how i do it ?
    this is the code on the homepage how it sorts the movies..

    <?php
    for ($i=0 ; $i<count($Data) ; $i++) {
    if ($i%5==0 && $i!=0) {
    echo '</tr>';
    }
    if ($i%5==0 || $i==0) {
    echo '<tr>';
    }
    ?>
    <td width="20%"><a href="play.php?id=<?=$Data[$i]['id']?>"><img src="<?=$Data[$i]['thumb']?>" alt="<?=$Data[$i]['url']?>" width="150" height="150" border="0" style="border:solid 1px #6699FF" title="<?=$Data[$i]['desc']?>" /></a></td>
    <?php
    if ($i==count($Data)-1) {
    echo '</tr>';
    }
    }
    ?>
    </table>
    </td></tr>
    <tr height="10"><td></td>
    </tr>
    <tr>
    <td align="center"><table width="60" border="0">
    <tr>
    <td><?php
    for ($i=0 ; $i<count($No) ; $i++) {
    ?></td>
    <td><a href="?p=<?=$No[$i]?>">
    <?=$No[$i]?>
    </a></td>
    <td><a href="?p=<?=$No[$i]?>">
    <?php
     
    -jay-, Mar 9, 2008 IP