作者Jahn (Somson)
看板PHP
標題[請益]照片分頁的問題
時間Fri Jul 8 21:55:13 2011
請問各位高手大大
使用下列程式碼的方式程現照片
但不管多少照片都呈現在都一頁
我也寫一個分頁程式,但不管我按
第一頁或第二頁它都呈現1~14張
(我一頁呈現14張)
請各位大大指導一下 我是否那邊
有錯 謝謝
<?php include "header.php" ?>
<link rel="stylesheet" rev="contents" href="Styles/album.css" />
<?php
if( is_null( $_GET['book'] ) ) exit;
$book = $_GET['book'];
$dirs = scandir("Album");
$AlbumName = iconv("big5","utf-8", $dirs[$book] );
$img = scandir( "Album/".$dirs[$book])
?>
<h1>活動剪影 - <?=$AlbumName?></h1>
<div style="width:90%; overflow:hidden; margin-bottom:50px;">
<?php
$listnum=14; //顯示的張數
$bb=ceil(count($img)/$listnum); //頁數 count($img):總數
/><br />
<span style="font-size:12px"><?=$photoName?></span>
</li>
<?
}}
?>
<?php
?>
</div>
<?php
for($k=1;$k<$bb;$k++)
{ ?>
<a href="AlbumShow.php?book=<?=$book?>&page=<?=$k?>"><? echo $k?></a>
<?
}
?>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.227.123.234
1F:→ eight0:感覺少PO了一些東西 $_GET["page"]呢? 07/08 23:12