Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

Pictures got the same link

Recommended Posts

this a code dividing picture sin different pages.. can any one tell me why does the pictures in the other pages, got the same link as the one in the first page...
[code]
$query=mysql_query("SELECT path,photo_id FROM tra_cotm_photo WHERE cotm_id='".$info['cotm_id']."' ORDER BY photo_id DESC LIMIT $cut,$max_page ")or die (mysql_error());

$get_num=mysql_result(mysql_query("SELECT COUNT(*) FROM tra_cotm_photo WHERE cotm_id=".$info['cotm_id'].""),0);

$total_pages=ceil($get_num / $max_page);
if($_GET['m']==$info['cotm_id']){
while($path=mysql_fetch_array($query)){
  if($i % $limit != 1) {
?><td align="center"><a href="cfv.php?m=<?php echo $info['cotm_id'];?>&p=<?php echo $i; ?>"><img border="0" height="90" width="110" src="<?php echo $path['path'];?>"></a></td>
<?php  } else { ?>
    </tr><tr><td  align="center"><a href="cfv.php?m=<?php echo $info['cotm_id']; ?>&p=<?php echo $i;?>"><img border="0" height="90" width="110" src="<?php echo $path['path'];?>"></a></td>
<?php  }
$i++;
}
}else
{}    


<?php if($_GET['m']==$info['cotm_id']){
?>
          <tr>
            <td colspan="3" align="center">
                <?php


for($i = 1; $i <= $total_pages; $i++){
    if(($page) == $i){
        echo "$i ";
        } else {
            echo "<a href=\"".$_SERVER['PHP_SELF']."?m=".$info['cotm_id']."&page=$i\">$i</a> ";
    }
}

}else
{}    

?>
[/code]

[b]EDITED BY WILDTEEN88: PLEASE USE SUITABLE TOPIC TITLES WHEN POSTING A NEW TOPIC. I HAVE CHANGED THE TITLE FOR YOU.[/b]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.