exit(page_renderer::render_main("Deleting $page - error","<p>You tried to delete $page, but you are not an admin so you don't have permission to do that.</p>
unset($pageindex->$page);//delete the page from the page index
file_put_contents("./pageindex.json",json_encode($pageindex,JSON_PRETTY_PRINT));//save the new page index
unlink("./$page.md");//delete the page from the disk
exit(page_renderer::render_main("Deleting $page - $settings->sitename","<p>$page has been deleted. <a href='index.php'>Go back to the main page</a>.</p>"));