디렉토리에 400 개 이상의 그림이있는 웹 사이트가 있습니다. 모든 페이지에 12 개씩 나열하고 싶습니다. 내가 어떻게 할 수 있니? 실제 코드는 다음과 같습니다.PHP 400 페이지의 페이지 넘김
<!doctype html>
<html lang="hu">
<head>
<title>Amatőr</title>
<meta charset="utf-8"/>
</head>
<body>
<h2><a href="../php/upload_picture.php" style="font-size:15pt; color:#ff00e8; text-decoration: none;">Vannak jó képeid? Töltsd fel őket és kikerülhetnek az oldalra!</a></h2>
<article>
<header>
Amatőr Lányok
</header>
<div id="kepek">
<?php
$imgdir = '../img/blog/img/amator/'; //Pick your folder
$allowed_types = array('png','jpg','jpeg','gif'); //Allowed types of files
$dimg = opendir($imgdir);//Open directory
while($imgfile = readdir($dimg))
{
if(in_array(strtolower(substr($imgfile,-3)),$allowed_types) OR
in_array(strtolower(substr($imgfile,-4)),$allowed_types))
/*If the file is an image add it to the array*/
{$a_img[] = $imgfile;}
}
$totimg = count($a_img); //The total count of all the images
//Echo out the images and their paths incased in an li.
for($x=0; $x < $totimg; $x++){ echo "<a onclick='Lightbox.start(this, false, false, false, false); return false;' rel='lightbox[amator]' href='" . $imgdir . $a_img[$x] . "'><img class='kep_listaz' width='200px' height='160px' src='" . $imgdir . $a_img[$x] . "' /></a>";}
?>
</div>
</article>
</body>
</html>
Thanks!
감사합니다. 문제는이 페이지가 ajax를 통해 브라우저에 넘겨 지므로 URL이 실제로 변경되지 않는다는 것입니다. ? = x를이 방법으로 추가하려면 어떻게합니까? – trisztann
ajax 호출에 대한 url을 변경할 수있는 이유가 없으며, ajax가 게시물 인 경우 param을 데이터로 보낼 수 있습니다. – swider
여기 내 현재 아약스 전화 : http://pastebin.com/BFvyS1jF입니다. 내가 올바르게 했습니까? URL의 끝에? page = 1을 추가했습니다. 또한 이미지 아래의 ajaxed 콘텐츠에 페이지 탐색을 추가하려면 어떻게해야합니까? 감사! – trisztann