Jump to content

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]
Link to comment
https://forums.phpfreaks.com/topic/12171-pictures-got-the-same-link/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.