v0.0.3 Made the delete function.

This commit is contained in:
Victor
2021-06-02 09:23:08 +02:00
parent 1bbefdfe08
commit 23a81e1925
3 changed files with 19 additions and 1 deletions
+16
View File
@@ -1 +1,17 @@
<?php
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");
}
}
+1 -1
View File
@@ -22,6 +22,6 @@ if(isset($_POST['createPost'])){
echo "Failed to save the post";
exit();
}else{
echo "Post has been saved";
header("location: ../../Frontend/home.php?Post=UploadSuccess");
}
}