D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
delete_event.php
back
Copy
<?php include "../config.php"; ?> <!DOCTYPE html> <html> <head> <title>Delete Event</title> </head> <body> <h1>Delete Event</h1> <?php // Check if the event ID is provided in the URL if (isset($_GET['id'])) { // Get the event ID from the URL $event_id = $_GET['id']; // SQL to delete the event $sql = "DELETE FROM events WHERE id = $event_id"; if ($conn->query($sql) === TRUE) { echo "Event deleted successfully!<br><a href='allevents.php'>Go back to home</a>"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } // Close the database connection $conn->close(); } else { echo "Invalid event ID."; } ?> </body> </html>