Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- a {color:red;}
- strong a {color:#666;}
- </style>
- <?php
- include 'kobling.php';
- $per_page = 1;
- $pages_query = mysql_query("SELECT COUNT(`id`) FROM `bilder`");
- $pages = ceil(mysql_result($pages_query, 0) / $per_page);
- $page = (isset($_GET['bilde'])) ? (int)$_GET['bilde'] : 1;
- $start = ($page - 1) * $per_page;
- $query = mysql_query("SELECT `bilde` FROM `bilder` ORDER BY id DESC LIMIT $start, $per_page");
- while($query_row = mysql_fetch_assoc($query)){
- echo $query_row['bilde'].'<br/>';
- }
- if($pages >= 1 && $page <= $pages){
- for($x = 1; $x<=$pages; $x++){
- echo ($x == $page) ? '<strong><a href="?bilde='.$x.'">'.$x.'</a></strong> ' : '<a href="?bilde='.$x.'">'.$x.'</a> ';
- }
- }
- else {
- echo '404! Y U NO FOUND?';
- }
- ?>
Add Comment
Please, Sign In to add comment