itskp-odense/Backend/controller/deletePost.php

18 lines
319 B
PHP
Raw Normal View History

<?php
2021-06-02 07:23:08 +00:00
require "../../bootstrap.php";
use Backend\Model\Post;
if(isset($_GET['id'])){
$id = $_GET['id'];
$findId = Post::query()->findOrFail($id);
if(!$findId->delete()){
echo "Error could not delete record";
}else{
header("location: ../../Frontend/home.php?recordDeleted");
}
}