Advertisement
Guest User

neat

a guest
Dec 6th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2. require("includes/conn.php");
  3.  
  4. if (isset($_GET["imagecount"]))
  5. $next = (int)$_GET["imagecount"]; //int is for sql injection
  6. else
  7.     $next = 0;
  8.     $result = mysql_query("select * from people WHERE id=$next") or die ("haznot DB: " . mysql_error());
  9.     while ($row = mysql_fetch_assoc($result))
  10.     {
  11.        echo "<img src=\"images/" . $row['filename'] . "\" alt=\"\" /><br />";
  12.     }
  13. ?>
  14. <!-- 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 -->
  15. <a href="images.php?imagecount=<?php echo $next+1; ?>">Next</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement