Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("includes/conn.php");
- if (isset($_GET["imagecount"]))
- $next = (int)$_GET["imagecount"]; //int is for sql injection
- else
- $next = 0;
- $result = mysql_query("select * from people WHERE id=$next") or die ("haznot DB: " . mysql_error());
- while ($row = mysql_fetch_assoc($result))
- {
- echo "<img src=\"images/" . $row['filename'] . "\" alt=\"\" /><br />";
- }
- ?>
- <!-- this next line will not work if you are missing an number. For example your id is 7, 8 has been deleted, so 9 would be next -->
- <a href="images.php?imagecount=<?php echo $next+1; ?>">Next</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement