Advertisement
Guest User

Untitled

a guest
May 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2. require_once 'config.php';
  3.  
  4. // Initialize the session
  5. session_start();
  6.  
  7.  
  8. // If session variable is not set it will redirect to login page
  9. if(!isset($_SESSION['act'])){
  10. header("location: login.php");
  11. exit;
  12. }
  13. ?>
  14.  
  15. //Some HTML is here
  16.  
  17. <?php
  18.  
  19. $coupons = mysqli_query($link, "SELECT * FROM coupons");
  20.  
  21.  
  22. while ($row = mysqli_fetch_array($coupons)) {
  23. // delete task
  24. if (isset($_GET['del_task'])) {
  25. $id = $_GET['del_task'];
  26.  
  27. $imgArray[] = $row['id'];
  28. $_SESSION['act'] = $imgArray;
  29.  
  30. unset($imgArray['id']);
  31. }
  32. ?>
  33.  
  34. <tr>
  35. <td class="task">
  36. <?php
  37. echo '<img src="data:image/jpeg;base64,'.base64_encode( $row['image'] ).'"/>';
  38. ?>
  39. </td>
  40. <td class="delete">
  41. <a href="welcome.php?del_task=<?php echo $row['id'] ?>">x</a>
  42. </td>
  43. </tr>
  44.  
  45. <?php
  46. }
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement