PHP ve Bootstrap ile İçerikleri Sayfalama (Pagination)

<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Galeri</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body class="container-fluid">
<div align="center">
<div class="row">
<div class="span6" style="float: none; margin: 0 auto;">
<?php

echo "<h4>Resim " . $_GET["no"] . "</h4>";
echo "<img src='galeri/" . $_GET["no"] . ".jpg' />";
?>
</div>
<div class="row">
<ul class="pagination">

<?php
echo "<li><a href='?no=1'>&laquo;</a></li>";
for ( $resimsayisi=1 ; $resimsayisi <= 5 ; $resimsayisi++ )
{
echo "<li><a href='?no=" . $resimsayisi . "' />" . $resimsayisi . "</a></li>";
}
$resimsayisi--;
echo "<li><a href='?no=". $resimsayisi . "'.>&raquo;</a></li>";
?>
</ul>
</div>
</div>
</div>
</body>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</html>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><ol></ol>
<title>Galeri</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body class="container-fluid">
<div align="center">
<div class="row">
<div class="span6" style="float: none; margin: 0 auto;">
<h4>Resim 3</h4><img src='galeri/3.jpg' /></div>
<div class="row">
<ul class="pagination">
<li><a href='?no=1'>&laquo;</a></li>
<li><a href='?no=1' />1</a></li>
<li><a href='?no=2' />2</a></li>
<li><a href='?no=3' />3</a></li>
<li><a href='?no=4' />4</a></li>
<li><a href='?no=5' />5</a></li>
<li><a href='?no=5'.>&raquo;</a></li>
</ul>
</div>
</div>
</div>
</body>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</html>

--

--

Full-stack Developer [ UI / UX | JAM Stack | ME(A,R,V)N | LAMP ], Author, Pro Gamer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store