test code snippet 2 with copy button

HTML
  
// demo code here
<!DOCTYPE html>
<html>
<head>
    <title>Image Quality Improvement with Canvas</title>
</head>
<body>
    <canvas id="canvas" width="400" height="300"></canvas>
    <input type="file" id="imageInput">
</body>
</html>
PHP
  
// demo code here

   <?php

   // Check if the user is logged in and get the user's ID

   // Replace this with your actual user authentication code



   // Get the product ID (replace with your actual method)

   $product_id = 123;



   // Query the database to check if the product is in the wishlist

   $user_id = 1; // Replace with the actual user's ID

   $query = "SELECT COUNT(*) AS count FROM wishlist WHERE user_id = $user_id AND product_id = $product_id";

   $result = mysqli_query($conn, $query);

   $row = mysqli_fetch_assoc($result);



   if ($row['count'] > 0) {

       // Product is in the wishlist

       echo "active"; // Return a response to the JavaScript

   } else {

       // Product is not in the wishlist

       echo "inactive"; // Return a response to the JavaScript

   }

   ?>



Previous
Next Post »