daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. case alpha:
  2.   $sql = "SELECT COUNT(file_name) FROM image";
  3.   $rs_result = mysql_query($sql);
  4.   $row = mysql_fetch_row($rs_result);
  5.   $total_records = $row[0];
  6.   $total_pages = ceil($total_records / 2);
  7.  
  8.   echo "page(s)&nbsp<a href='image.php?page=100&id=".$_GET['id']."'>ALL</a>";
  9.  
  10.   for ($i=1; $i<=$total_pages; $i++) {
  11.    echo "&nbsp<a href='image.php?page=".$i."&id=".$_GET['id']."'>".$i."</a>";
  12.   }
  13.  
  14.   if ($_get["page"]==$page) {
  15.    if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; };
  16.    $start_from = ($page-1) * 2;
  17.    $query = "SELECT * FROM image ORDER BY file_name LIMIT $start_from, 2";
  18.    $result = mysql_query ($query);
  19.  
  20.    while ($row = mysql_fetch_array($result)) {
  21.     $result_array[]="<a href='image/".$row['file_link']."' target='_blank'><img src='image/".$row['file_link']."'
  22.  
  23. width='150px' height='100px' /><br><center>".$row['file_name']."</center>";
  24.    }
  25.  
  26.    mysql_free_result($result);
  27.  
  28.    $counter=1;
  29.    echo "<table>";
  30.    echo "<tr>";
  31.  
  32.    foreach ($result_array as $link) {
  33.     if ($counter <= 1) {
  34.     echo "<td>";
  35.     echo $link;
  36.     echo "</td>";
  37.     $counter ++;
  38.     }
  39.     else {
  40.     echo "<td>";
  41.     echo $link;
  42.     echo "</td>";
  43.     echo "</tr><tr>";
  44.     $counter=1;
  45.     }
  46.    }
  47.   }
  48.  
  49.   else {
  50.    if ($_get["page"]=ALL and $_get['id']=$_get['id']) {
  51.  
  52.     $query="select * from image order by file_name";
  53.     $result=mysql_query($query);
  54.    
  55.     while ($row = mysql_fetch_array($result)) {
  56.      $result_array[]="<a href='image/".$row['file_link']."' target='_blank'><img src='image/".$row['file_link']."'
  57.  
  58. width='150px' height='100px' /></a><br><center>".$row['file_name']."</center>";
  59.     }
  60.  
  61.     $counter=1;
  62.     echo "<table>";
  63.     echo "<tr>";
  64.  
  65.     foreach ($result_array as $link) {
  66.  
  67.      if ($counter <= 3) {
  68.       echo "<td>";
  69.       echo $link;
  70.       echo "</td>";
  71.       $counter ++;
  72.      }
  73.      else {
  74.       echo "<td>";
  75.       echo $link;
  76.       echo "</td>";
  77.       echo "</tr><tr>";
  78.       $counter=1;
  79.      }
  80.     }
  81.    }
  82.   }
  83.  
  84. break;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top