One Hat Cyber Team
Your IP :
216.73.216.186
Server IP :
88.222.243.132
Server :
Linux in-mum-web1837.main-hosting.eu 5.14.0-503.34.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 27 06:00:50 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
u322583024
/
domains
/
awaha.in
/
public_html
/
Edit File:
count.php
<?php session_name('vaishnavi_awaha'); session_start(); include 'admin/connect.inc.php'; // Include the correct connection file if (!$conn) { die("Database connection failed"); } $wishlist_count = 0; // Variable to store the count of wishlist items if (isset($_SESSION['user_id'])) { $user_id = $_SESSION['user_id']; // Query to fetch wishlist items for logged-in user $stmt = $conn->prepare(" SELECT COUNT(*) AS wishlist_count FROM wishlist w JOIN products p ON w.product_id = p.id WHERE w.user_id = ? "); $stmt->bind_param('i', $user_id); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { $wishlist_count = $row['wishlist_count']; // Get the count of wishlist items } $stmt->close(); } else { // Check if the wishlist is stored in cookies for non-logged-in users $wishlist = isset($_COOKIE['wishlist']) ? json_decode($_COOKIE['wishlist'], true) : []; // Set the count of items in the cookie-based wishlist $wishlist_count = count($wishlist); } $conn->close(); // Return the wishlist count as a JSON response echo json_encode(['wishlist_count' => $wishlist_count]); ?>
Simpan