Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'config.php';
- // Initialize the session
- session_start();
- // If session variable is not set it will redirect to login page
- if(!isset($_SESSION['act'])){
- header("location: login.php");
- exit;
- }
- ?>
- //Some HTML is here
- <?php
- $coupons = mysqli_query($link, "SELECT * FROM coupons");
- while ($row = mysqli_fetch_array($coupons)) {
- // delete task
- if (isset($_GET['del_task'])) {
- $id = $_GET['del_task'];
- $imgArray[] = $row['id'];
- $_SESSION['act'] = $imgArray;
- unset($imgArray['id']);
- }
- ?>
- <tr>
- <td class="task">
- <?php
- echo '<img src="data:image/jpeg;base64,'.base64_encode( $row['image'] ).'"/>';
- ?>
- </td>
- <td class="delete">
- <a href="welcome.php?del_task=<?php echo $row['id'] ?>">x</a>
- </td>
- </tr>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement