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:

// 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);
$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>';

I get this after clicking the link:


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..

Made it work.... :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.