Domain: amberpublishers.in
Server Adress: 86.38.243.169
privdayz.com
<?php
session_start();
require 'include/PHPHelper.php';
if (!isset($_SESSION['userID'])) {
header("location: login.php");
} else {
if (isset($_GET['id'])) {
$paperId = $_GET['id'];
// Retrieve paper information from the database
$sql = "SELECT * FROM papers WHERE paper_id = '$paperId'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_assoc($result);
// Delete the PDF file from the folder
$pdfPath = '../ijsri/resource/papers/' . $row['full_text_url'];
if (file_exists($pdfPath)) {
unlink($pdfPath);
}
// Delete the paper from the database
$deleteSql = "DELETE FROM papers WHERE paper_id = '$paperId'";
if (mysqli_query($conn, $deleteSql)) {
header("Location: editpaperdetails.php?success=1");
exit;
} else {
header("Location: editpaperdetails.php?error=2");
exit;
}
} else {
header("Location: editpaperdetails.php?error=2");
exit;
}
} else {
header("Location: editpaperdetails.php");
exit;
}
}
?>
