分页展示内容的代码?

WBOY
Release: 2016-06-13 13:13:23
Original
843 people have browsed it

分页显示内容的代码??

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<?php $y=1;
while ($y<=50)
{
echo "<img  src=pic".$y.".jpg alt=" 分页展示内容的代码? " ><br>";
$y++;
}
?>

Copy after login


我这里显示了与此文件同目录的50张图片【pic1.jpg~pic50.jpg】
现在我想把这些图片分页显示,每页显示10张图片,并且插入“上一页,下一页”的连接。这个代码怎么写??

------解决方案--------------------
一样的 get 一个变量 判断是否已经超过$y数值 不是的话 从这个变量 偏移 10位 循环输出 .
至于下一页这个就是传递上面的变量给页面.上一页就是减去10
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!