0

I was adding a link to make it poosible to delete a page on a site, which is not yet published.

the link looks like this, with the processing below it:

<?php 
// The Link
echo '<a href=\"process_delete_page.php?pid=' . $id . '">Slet siden her!</a>'; 

// Processing the request
$id = $_GET['id'];

include_once "../includes/connection.php";

$query="SELECT pos, subjectid FROM pages WHERE id=$id";
$result = mysqli_query($myConnection, $query);
while($row=mysqli_fetch_array($result)){
$position = $row['pos'];
$subjectid = $row['subjectid'];			
}
// Add the updated info into the database table..................................
$queryAdjustPosition = mysqli_query($myConnection, "UPDATE pages SET pos = pos - 1 WHERE pos > $position AND subjectid = $subjectid");

$query = mysqli_query($myConnection, "DELETE FROM pages WHERE id='$id'") or die (mysqli_error($myConnection));

echo '<div align="center">Page has been deleted successfully. <br /><br />
<a href="admin.php">Click here to head back to admin home!</a></div>';
exit();
?>

I get this after clicking the link:

Forbidden

You don't have permission to access /"process_delete_page.php on this server.

And the title of the error page giving that message, is displaying:

403 Forbidden

How come this happens, and how can I change this?

Its just a request to the database about deleting a record, hmmm..

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by klemme
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.