BLACKSITE
:
216.73.217.4
:
104.37.75.190 / alpenpass.ca
:
Linux server3.pointsplan.com 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
:
/
home2
/
apca
/
public_html
/
Upload File:
files >> //home2/apca/public_html/remove_rental.php
<?php session_start(); include('includes/config.php'); // Ensure user is logged in if (!isset($_SESSION['login'])) { die("Error: User is not logged in."); } $user_email = $_SESSION['login']; // Use email as user_id $user_id= $_SESSION['id']; // Check if ID is provided in the URL if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { die("Error: Invalid request."); } $rental_id = intval($_GET['id']); // Ensure the item belongs to the logged-in user before deleting $stmt = $dbh->prepare("DELETE FROM rental_cart WHERE id = :id AND user_id = :user_id"); $stmt->bindParam(':id', $rental_id, PDO::PARAM_INT); $stmt->bindParam(':user_id', $user_id, PDO::PARAM_STR); if ($stmt->execute()) { $message = "Rental item removed successfully."; } else { $message = "Error removing rental item."; } // Redirect back to rental cart with a success message header("Location: rental_cart.php?message=" . urlencode($message)); exit(); ?>