作者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